File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ elseif(BUILD_ALL_EXTENSIONS)
4040 message (FATAL_ERROR "Vulkan headers not found" )
4141endif ()
4242
43+ find_package (Threads REQUIRED)
4344find_package (JsonCpp)
4445
4546### All options defined here
Original file line number Diff line number Diff line change @@ -131,11 +131,13 @@ if(NOT BUILD_LOADER_WITH_EXCEPTION_HANDLING)
131131 PRIVATE XRLOADER_DISABLE_EXCEPTION_HANDLING
132132 )
133133endif ()
134- target_link_libraries (openxr_loader PRIVATE openxr- all -supported)
135-
136- target_compile_definitions (openxr_loader
137- PRIVATE API_NAME= "OpenXR"
134+ target_link_libraries (
135+ openxr_loader
136+ PRIVATE openxr- all -supported ${CMAKE_DL_LIBS}
137+ PUBLIC ${CMAKE_THREAD_LIBS_INIT}
138138)
139+
140+ target_compile_definitions (openxr_loader PRIVATE API_NAME="OpenXR" )
139141if (CMAKE_SYSTEM_NAME STREQUAL "Linux" )
140142 target_compile_definitions (openxr_loader
141143 PRIVATE FALLBACK_CONFIG_DIRS="${FALLBACK_CONFIG_DIRS} "
@@ -147,12 +149,17 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
147149 endif ()
148150
149151 set_target_properties (openxr_loader PROPERTIES SOVERSION "${MAJOR} " VERSION "${MAJOR} .${MINOR} .${PATCH} " )
150- target_link_libraries (openxr_loader PRIVATE stdc++fs dl PUBLIC pthread m)
152+ target_link_libraries (
153+ openxr_loader
154+ PRIVATE stdc++fs
155+ PUBLIC m
156+ )
151157
152158 add_custom_target (libopenxr_loader.so.${MAJOR} .${MINOR} ALL
153159 COMMAND ${CMAKE_COMMAND} -E create_symlink libopenxr_loader.so.${MAJOR} .${MINOR} .${PATCH} libopenxr_loader.so.${MAJOR} .${MINOR} )
154160
155161 set (XR_API_VERSION "${MAJOR} .${MINOR} " )
162+ set (EXTRA_LIBS ${CMAKE_THREAD_LIBS_INIT} )
156163 configure_file ("openxr.pc.in" "openxr.pc" @ONLY)
157164 install (FILES "${CMAKE_CURRENT_BINARY_DIR} /openxr.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR} /pkgconfig" )
158165elseif (WIN32 )
Original file line number Diff line number Diff line change @@ -6,6 +6,6 @@ includedir=${prefix}/include
66Name: @CMAKE_PROJECT_NAME@
77Description: OpenXR Loader
88Version: @XR_API_VERSION@
9- Libs: -L${libdir} -lopenxr_loader @PRIVATE_LIBS @
9+ Libs: -L${libdir} -lopenxr_loader @EXTRA_LIBS @
1010Cflags: -I${includedir}
1111
You can’t perform that action at this time.
0 commit comments