2022-04-10 12:45:04 +00:00
|
|
|
# Copyright 2019-2022, Collabora, Ltd.
|
2019-04-18 12:02:30 +00:00
|
|
|
# SPDX-License-Identifier: BSL-1.0
|
|
|
|
|
2020-06-01 08:54:15 +00:00
|
|
|
###
|
|
|
|
# Main code
|
|
|
|
#
|
|
|
|
|
2021-11-11 23:41:58 +00:00
|
|
|
add_library(
|
|
|
|
st_oxr STATIC
|
2019-04-18 12:02:30 +00:00
|
|
|
oxr_api_action.c
|
|
|
|
oxr_api_funcs.h
|
|
|
|
oxr_api_instance.c
|
|
|
|
oxr_api_negotiate.c
|
|
|
|
oxr_api_session.c
|
|
|
|
oxr_api_space.c
|
|
|
|
oxr_api_swapchain.c
|
|
|
|
oxr_api_system.c
|
|
|
|
oxr_api_verify.h
|
2019-09-02 21:04:13 +00:00
|
|
|
oxr_binding.c
|
2019-06-03 19:12:01 +00:00
|
|
|
oxr_chain.h
|
2019-10-08 14:35:16 +00:00
|
|
|
oxr_event.c
|
2019-08-19 17:37:50 +00:00
|
|
|
oxr_extension_support.h
|
2019-04-18 12:02:30 +00:00
|
|
|
oxr_handle_base.c
|
2019-05-07 12:47:18 +00:00
|
|
|
oxr_input.c
|
2020-06-15 15:58:48 +00:00
|
|
|
oxr_input_transform.c
|
|
|
|
oxr_input_transform.h
|
2019-04-18 12:02:30 +00:00
|
|
|
oxr_instance.c
|
2019-10-08 14:35:16 +00:00
|
|
|
oxr_logger.c
|
2019-04-18 12:02:30 +00:00
|
|
|
oxr_logger.h
|
|
|
|
oxr_objects.h
|
|
|
|
oxr_path.c
|
2022-04-10 12:45:04 +00:00
|
|
|
oxr_pretty_print.c
|
|
|
|
oxr_pretty_print.h
|
2019-04-18 12:02:30 +00:00
|
|
|
oxr_session.c
|
2021-06-20 14:01:49 +00:00
|
|
|
oxr_session_frame_end.c
|
2019-04-18 12:02:30 +00:00
|
|
|
oxr_space.c
|
|
|
|
oxr_swapchain.c
|
|
|
|
oxr_system.c
|
|
|
|
oxr_two_call.h
|
2019-10-08 14:40:40 +00:00
|
|
|
oxr_verify.c
|
2019-05-07 12:47:18 +00:00
|
|
|
oxr_xdev.c
|
2019-04-18 12:02:30 +00:00
|
|
|
)
|
|
|
|
|
2020-07-16 10:17:30 +00:00
|
|
|
if(XRT_HAVE_VULKAN)
|
2022-05-02 15:27:17 +00:00
|
|
|
target_compile_definitions(st_oxr PRIVATE XR_USE_GRAPHICS_API_VULKAN)
|
2021-11-11 23:41:58 +00:00
|
|
|
target_sources(st_oxr PRIVATE oxr_session_gfx_vk.c oxr_swapchain_vk.c oxr_vulkan.c)
|
|
|
|
target_link_libraries(st_oxr PUBLIC Vulkan::Vulkan)
|
2020-07-16 10:17:30 +00:00
|
|
|
endif()
|
|
|
|
|
2020-04-29 23:11:43 +00:00
|
|
|
if(XRT_HAVE_OPENGL)
|
2021-11-11 23:41:58 +00:00
|
|
|
target_compile_definitions(st_oxr PRIVATE XR_USE_GRAPHICS_API_OPENGL)
|
2020-07-16 22:22:59 +00:00
|
|
|
endif()
|
|
|
|
if(XRT_HAVE_OPENGLES)
|
2021-11-11 23:41:58 +00:00
|
|
|
target_compile_definitions(st_oxr PRIVATE XR_USE_GRAPHICS_API_OPENGL_ES)
|
2020-07-16 22:22:59 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES)
|
2022-05-02 14:57:22 +00:00
|
|
|
target_sources(st_oxr PRIVATE oxr_swapchain_gl.c)
|
2021-11-11 23:41:58 +00:00
|
|
|
target_link_libraries(st_oxr PUBLIC aux_ogl)
|
2019-12-03 23:40:38 +00:00
|
|
|
endif()
|
|
|
|
|
2022-05-02 14:58:19 +00:00
|
|
|
if(XRT_HAVE_OPENGL_GLX AND XRT_HAVE_XLIB)
|
2021-11-11 23:41:58 +00:00
|
|
|
target_compile_definitions(st_oxr PRIVATE XR_USE_PLATFORM_XLIB)
|
2022-05-02 14:57:22 +00:00
|
|
|
target_sources(st_oxr PRIVATE oxr_session_gfx_gl_xlib.c)
|
2019-12-03 23:40:38 +00:00
|
|
|
endif()
|
|
|
|
|
2020-04-29 23:11:43 +00:00
|
|
|
if(XRT_HAVE_EGL)
|
2021-11-11 23:41:58 +00:00
|
|
|
target_compile_definitions(st_oxr PRIVATE XR_USE_PLATFORM_EGL)
|
|
|
|
target_sources(st_oxr PRIVATE oxr_session_gfx_egl.c)
|
2019-12-03 23:40:38 +00:00
|
|
|
endif()
|
|
|
|
|
2022-05-24 22:19:52 +00:00
|
|
|
if(XRT_HAVE_D3D11 OR XRT_HAVE_D3D12)
|
|
|
|
target_sources(st_oxr PRIVATE oxr_d3d.cpp)
|
|
|
|
target_link_libraries(st_oxr PRIVATE aux_d3d)
|
|
|
|
endif()
|
|
|
|
|
2022-05-16 15:44:47 +00:00
|
|
|
if(XRT_HAVE_D3D11)
|
|
|
|
target_compile_definitions(st_oxr PRIVATE XR_USE_GRAPHICS_API_D3D11)
|
|
|
|
target_sources(st_oxr PRIVATE oxr_session_gfx_d3d11.c oxr_swapchain_d3d11.c oxr_d3d11.cpp)
|
|
|
|
endif()
|
|
|
|
|
2020-08-19 20:56:38 +00:00
|
|
|
if(ANDROID)
|
2021-11-11 23:41:58 +00:00
|
|
|
target_compile_definitions(st_oxr PRIVATE XR_USE_PLATFORM_ANDROID)
|
|
|
|
target_sources(st_oxr PRIVATE oxr_session_gfx_gles_android.c)
|
2020-08-19 20:56:38 +00:00
|
|
|
target_link_libraries(st_oxr PRIVATE aux_android)
|
|
|
|
endif()
|
2021-11-11 23:41:58 +00:00
|
|
|
|
|
|
|
target_link_libraries(
|
|
|
|
st_oxr
|
2020-06-15 15:58:48 +00:00
|
|
|
PRIVATE
|
2021-11-11 23:41:58 +00:00
|
|
|
xrt-interfaces
|
|
|
|
xrt-external-openxr
|
|
|
|
aux_util
|
|
|
|
aux_math
|
|
|
|
aux_generated_bindings
|
|
|
|
comp_client
|
|
|
|
aux-includes
|
|
|
|
PUBLIC aux_os
|
|
|
|
)
|
|
|
|
|
2022-05-03 16:57:38 +00:00
|
|
|
if(XRT_FEATURE_RENDERDOC)
|
|
|
|
target_link_libraries(st_oxr PUBLIC xrt-external-renderdoc)
|
|
|
|
if(XRT_HAVE_LINUX)
|
|
|
|
target_link_libraries(st_oxr PRIVATE ${CMAKE_DL_LIBS})
|
|
|
|
endif()
|
2022-02-18 01:13:32 +00:00
|
|
|
endif()
|
|
|
|
|
2021-11-11 23:41:58 +00:00
|
|
|
target_include_directories(
|
|
|
|
st_oxr
|
|
|
|
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/..
|
|
|
|
)
|