mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-04 06:06:17 +00:00
xrt: Move OpenXR platform defines to build system
This commit is contained in:
parent
130a649f92
commit
f834d20300
|
@ -9,12 +9,8 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// Move these to the build system instead.
|
//! @todo Move these to the build system instead.
|
||||||
#define XR_USE_GRAPHICS_API_OPENGL
|
|
||||||
#define XR_USE_GRAPHICS_API_OPENGL_ES
|
|
||||||
#define XR_USE_GRAPHICS_API_VULKAN
|
#define XR_USE_GRAPHICS_API_VULKAN
|
||||||
#define XR_USE_PLATFORM_XLIB
|
|
||||||
#define XR_USE_PLATFORM_EGL
|
|
||||||
#define XR_USE_TIMESPEC 1
|
#define XR_USE_TIMESPEC 1
|
||||||
|
|
||||||
#ifdef XR_USE_PLATFORM_XLIB
|
#ifdef XR_USE_PLATFORM_XLIB
|
||||||
|
|
|
@ -43,6 +43,18 @@ set(OXR_SOURCE_FILES
|
||||||
oxr_xdev.c
|
oxr_xdev.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(BUILD_WITH_OPENGL)
|
||||||
|
add_definitions(-DXR_USE_GRAPHICS_API_OPENGL -DXR_USE_GRAPHICS_API_OPENGL_ES)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(BUILD_WITH_XLIB)
|
||||||
|
add_definitions(-DXR_USE_PLATFORM_XLIB)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(BUILD_WITH_EGL)
|
||||||
|
add_definitions(-DXR_USE_PLATFORM_EGL)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Use OBJECT to not create a archive, since it just gets in the way.
|
# Use OBJECT to not create a archive, since it just gets in the way.
|
||||||
add_library(st_oxr OBJECT ${OXR_SOURCE_FILES})
|
add_library(st_oxr OBJECT ${OXR_SOURCE_FILES})
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,19 @@
|
||||||
# Copyright 2019, Collabora, Ltd.
|
# Copyright 2019, Collabora, Ltd.
|
||||||
# SPDX-License-Identifier: BSL-1.0
|
# SPDX-License-Identifier: BSL-1.0
|
||||||
|
|
||||||
|
compile_args = []
|
||||||
|
if x11.found()
|
||||||
|
compile_args += ['-DXR_USE_GRAPHICS_API_OPENGL', '-DXR_USE_GRAPHICS_API_OPENGL_ES']
|
||||||
|
endif
|
||||||
|
|
||||||
|
if egl.found()
|
||||||
|
compile_args += ['-DXR_USE_PLATFORM_EGL']
|
||||||
|
endif
|
||||||
|
|
||||||
|
if opengl.found()
|
||||||
|
compile_args += ['-DXR_USE_PLATFORM_XLIB']
|
||||||
|
endif
|
||||||
|
|
||||||
lib_st_oxr = static_library(
|
lib_st_oxr = static_library(
|
||||||
'st_oxr',
|
'st_oxr',
|
||||||
files(
|
files(
|
||||||
|
@ -43,4 +56,6 @@ lib_st_oxr = static_library(
|
||||||
external_include,
|
external_include,
|
||||||
],
|
],
|
||||||
dependencies: [aux, vulkan],
|
dependencies: [aux, vulkan],
|
||||||
|
c_args: compile_args,
|
||||||
|
cpp_args: compile_args,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue