File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,16 @@ option(
6161 "Enable exception handling in the loader. Leave this on unless your standard library is built to not throw."
6262 ON
6363)
64+
65+ set (BUILD_WITHOUT_STD_FILESYSTEM_DEFAULT OFF )
66+ if (MINGW)
67+ # Debian 10's MinGW has a bug in the experimental filesystem support
68+ # and MinGW on Windows doesn't apparently have any?
69+ set (BUILD_WITHOUT_STD_FILESYSTEM_DEFAULT ON )
70+ endif ()
71+ option (BUILD_WITHOUT_STD_FILESYSTEM "Force building without std::[experimental::]filesystem."
72+ ${BUILD_WITHOUT_STD_FILESYSTEM_DEFAULT} )
73+
6474if (CMAKE_SYSTEM_NAME STREQUAL "Windows" )
6575 option (DYNAMIC_LOADER "Build the loader as a .dll library" OFF )
6676else ()
Original file line number Diff line number Diff line change @@ -145,9 +145,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
145145 set_target_properties (openxr_loader PROPERTIES SOVERSION "${MAJOR} " VERSION "${MAJOR} .${MINOR} .${PATCH} " )
146146 target_link_libraries (
147147 openxr_loader
148- PRIVATE stdc++fs
149148 PUBLIC m
150149 )
150+ if (NOT BUILD_WITHOUT_STD_FILESYSTEM)
151+ target_link_libraries (openxr_loader PRIVATE stdc++fs)
152+ endif ()
151153
152154 add_custom_target (
153155 libopenxr_loader.so.${MAJOR} .${MINOR} ALL
@@ -236,6 +238,9 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
236238 target_compile_options (openxr_loader PRIVATE -Wimplicit-fallthrough=0)
237239 endif ()
238240endif ()
241+ if (BUILD_WITHOUT_STD_FILESYSTEM)
242+ target_compile_definitions (openxr_loader PRIVATE DISABLE_STD_FILESYSTEM)
243+ endif ()
239244
240245install (
241246 TARGETS openxr_loader
You can’t perform that action at this time.
0 commit comments