@@ -20,7 +20,6 @@ add_executable(loader_test
2020 loader_test.cpp
2121 ${PROJECT_SOURCE_DIR} /src/common/gfxwrapper_opengl.c
2222 ${PROJECT_SOURCE_DIR} /src/common/filesystem_utils.cpp
23- ${WAYLAND_PROTOCOL_SRC}
2423)
2524set_target_properties (loader_test PROPERTIES FOLDER ${TESTS_FOLDER} )
2625
@@ -45,10 +44,23 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
4544 target_compile_options (loader_test PRIVATE /Zc:wchar_t /Zc:forScope /W4 /WX)
4645 target_link_libraries (loader_test openxr_loader opengl32 d3d11)
4746elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux" )
48- target_compile_options (loader_test PRIVATE -Wall -Wno-unused-function -Wno-format-truncation)
49- target_link_libraries (loader_test -lstdc++fs openxr_loader m -lpthread GL ${XLIB_LIBRARIES} ${XCB_LIBRARIES} ${WAYLAND_LIBRARIES} )
47+ target_compile_options (
48+ loader_test PRIVATE -Wall -Wno-unused-function -Wno-format-truncation
49+ )
50+
51+ if (PRESENTATION_BACKEND MATCHES "xlib" )
52+ target_link_libraries (
53+ loader_test ${X11_Xxf86vm_LIB} ${X11_Xrandr_LIB} ${X11_LIBRARIES}
54+ )
55+ elseif (PRESENTATION_BACKEND MATCHES "xcb" )
56+ target_link_libraries (loader_test ${XCB_LIBRARIES} )
57+ elseif (PRESENTATION_BACKEND MATCHES "wayland" )
58+ target_link_libraries (loader_test ${WAYLAND_LIBRARIES} )
59+ target_sources (loader_test PRIVATE ${WAYLAND_PROTOCOL_SRC} )
60+ endif ()
61+ target_link_libraries (loader_test -lstdc++fs openxr_loader m -lpthread GL)
5062else ()
51- MESSAGE (FATAL_ERROR "Unsupported Platform" )
63+ message (FATAL_ERROR "Unsupported Platform" )
5264endif ()
5365
5466file (MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} /resources)
0 commit comments