The open source OpenXR runtime
at prediction 119 lines 3.6 kB view raw
1# Copyright 2018-2024, Collabora, Ltd. 2# Copyright 2024-2025, NVIDIA CORPORATION. 3# 4# SPDX-License-Identifier: BSL-1.0 5 6set(tests 7 tests_cxx_wrappers 8 tests_deque 9 tests_generic_callbacks 10 tests_history_buf 11 tests_id_ringbuffer 12 tests_json 13 tests_lowpass_float 14 tests_lowpass_integer 15 tests_pacing 16 tests_quatexpmap 17 tests_quat_change_of_basis 18 tests_quat_swing_twist 19 tests_rational 20 tests_relation_chain 21 tests_vector 22 tests_worker 23 tests_pose 24 tests_vec3_angle 25 ) 26if(XRT_HAVE_D3D11) 27 list(APPEND tests tests_aux_d3d_d3d11 tests_comp_client_d3d11) 28endif() 29if(XRT_HAVE_D3D12) 30 list(APPEND tests tests_aux_d3d_d3d12 tests_comp_client_d3d12) 31endif() 32if(XRT_HAVE_VULKAN) 33 list(APPEND tests tests_comp_client_vulkan tests_uv_to_tangent) 34endif() 35if(XRT_FEATURE_OPENXR) 36 list(APPEND tests tests_input_transform) 37endif() 38if(XRT_HAVE_OPENGL 39 AND XRT_HAVE_OPENGL_GLX 40 AND XRT_HAVE_SDL2 41 AND (WIN32 OR VK_USE_PLATFORM_XLIB_XRANDR_EXT) 42 ) 43 set(_have_opengl_test ON) 44 list(APPEND tests tests_comp_client_opengl) 45endif() 46if(XRT_BUILD_DRIVER_HANDTRACKING) 47 list(APPEND tests tests_levenbergmarquardt) 48endif() 49 50foreach(testname ${tests}) 51 add_executable(${testname} ${testname}.cpp) 52 target_link_libraries(${testname} PRIVATE xrt-external-catch2) 53 target_link_libraries(${testname} PRIVATE aux_util) 54 add_test(NAME ${testname} COMMAND ${testname} --success --allow-running-no-tests) 55 set_target_properties(${testname} PROPERTIES FOLDER monado_tests) 56endforeach() 57 58# For tests that require more than just aux_util, link those other libs down here. 59 60target_link_libraries(tests_cxx_wrappers PRIVATE xrt-interfaces) 61target_link_libraries(tests_history_buf PRIVATE aux_math) 62target_link_libraries(tests_lowpass_float PRIVATE aux_math) 63target_link_libraries(tests_lowpass_integer PRIVATE aux_math) 64target_link_libraries(tests_quatexpmap PRIVATE aux_math) 65target_link_libraries(tests_rational PRIVATE aux_math) 66target_link_libraries(tests_relation_chain PRIVATE aux_math) 67target_link_libraries(tests_pose PRIVATE aux_math) 68target_link_libraries(tests_quat_change_of_basis PRIVATE aux_math) 69target_link_libraries(tests_quat_swing_twist PRIVATE aux_math) 70target_link_libraries(tests_vec3_angle PRIVATE aux_math) 71 72if(XRT_BUILD_DRIVER_HANDTRACKING) 73 target_link_libraries( 74 tests_levenbergmarquardt 75 PRIVATE 76 aux_math 77 t_ht_mercury_includes 78 t_ht_mercury_kine_lm_includes 79 t_ht_mercury 80 t_ht_mercury_kine_lm 81 ) 82endif() 83 84if(XRT_HAVE_D3D11) 85 target_link_libraries(tests_aux_d3d_d3d11 PRIVATE aux_d3d) 86 target_link_libraries(tests_comp_client_d3d11 PRIVATE comp_client comp_mock) 87endif() 88 89if(XRT_HAVE_D3D12) 90 target_link_libraries(tests_aux_d3d_d3d12 PRIVATE aux_d3d) 91 target_link_libraries(tests_comp_client_d3d12 PRIVATE comp_client comp_mock) 92endif() 93 94if(XRT_HAVE_VULKAN) 95 target_link_libraries( 96 tests_comp_client_vulkan PRIVATE comp_client comp_mock comp_util aux_vk 97 ) 98 target_link_libraries(tests_uv_to_tangent PRIVATE comp_render) 99endif() 100 101if(XRT_FEATURE_OPENXR) 102 target_link_libraries( 103 tests_input_transform PRIVATE st_oxr xrt-interfaces xrt-external-openxr 104 ) 105endif() 106if(_have_opengl_test) 107 target_link_libraries( 108 tests_comp_client_opengl PRIVATE comp_client comp_mock aux_ogl SDL2::SDL2 109 ) 110 target_include_directories(tests_comp_client_opengl PRIVATE SDL2::SDL2) 111endif() 112 113if(XRT_HAVE_VULKAN AND XRT_HAVE_D3D11) 114 target_link_libraries(tests_aux_d3d_d3d11 PRIVATE comp_util aux_vk) 115endif() 116 117if(XRT_HAVE_VULKAN AND XRT_HAVE_D3D12) 118 target_link_libraries(tests_aux_d3d_d3d12 PRIVATE comp_util aux_vk) 119endif()