mirror of
https://github.com/lbgos/rift-s-linux.git
synced 2026-10-28 00:00:50 +01:00
xrt: Move OpenXR platform defines to build system
This commit is contained in:
1 parent
130a649f92
commit
f834d20300
3 files changed
+28
-5
No files matched your search
@@ -9,12 +9,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// Move these to the build system instead.
|
||||
#define XR_USE_GRAPHICS_API_OPENGL
|
||||
#define XR_USE_GRAPHICS_API_OPENGL_ES
|
||||
//! @todo Move these to the build system instead.
|
||||
#define XR_USE_GRAPHICS_API_VULKAN
|
||||
#define XR_USE_PLATFORM_XLIB
|
||||
#define XR_USE_PLATFORM_EGL
|
||||
#define XR_USE_TIMESPEC 1
|
||||
|
||||
#ifdef XR_USE_PLATFORM_XLIB
|
||||
|
||||
@@ -43,6 +43,18 @@ set(OXR_SOURCE_FILES
|
||||
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.
|
||||
add_library(st_oxr OBJECT ${OXR_SOURCE_FILES})
|
||||
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
# Copyright 2019, Collabora, Ltd.
|
||||
# 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(
|
||||
'st_oxr',
|
||||
files(
|
||||
@@ -43,4 +56,6 @@ lib_st_oxr = static_library(
|
||||
external_include,
|
||||
],
|
||||
dependencies: [aux, vulkan],
|
||||
c_args: compile_args,
|
||||
cpp_args: compile_args,
|
||||
)
|
||||
Reference in new issue
Block a user