File tree 2 files changed +16
-0
lines changed
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,16 @@ option(
53
53
"Enable exception handling in the loader. Leave this on unless your standard library is built to not throw."
54
54
ON
55
55
)
56
+
57
+ set (BUILD_WITHOUT_STD_FILESYSTEM_DEFAULT OFF )
58
+ if (MINGW)
59
+ # Debian 10's MinGW has a bug in the experimental filesystem support
60
+ # and MinGW on Windows doesn't apparently have any?
61
+ set (BUILD_WITHOUT_STD_FILESYSTEM_DEFAULT ON )
62
+ endif ()
63
+ option (BUILD_WITHOUT_STD_FILESYSTEM "Force building without std::[experimental::]filesystem."
64
+ ${BUILD_WITHOUT_STD_FILESYSTEM_DEFAULT} )
65
+
56
66
if (CMAKE_SYSTEM_NAME STREQUAL "Windows" )
57
67
option (DYNAMIC_LOADER "Build the loader as a .dll library" OFF )
58
68
else ()
Original file line number Diff line number Diff line change @@ -222,12 +222,18 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
222
222
-ffunction-sections
223
223
-fdata-sections
224
224
)
225
+ if (NOT BUILD_WITHOUT_STD_FILESYSTEM)
226
+ target_link_libraries (openxr_loader PRIVATE stdc++fs)
227
+ endif ()
225
228
# For GCC version 7.1 or greater, we need to disable the implicit fallthrough warning since
226
229
# there's no consistent way to satisfy all compilers until they all accept the C++17 standard
227
230
if (CMAKE_COMPILER_IS_GNUCC AND NOT (CMAKE_CXX_COMPILER_VERSION LESS 7.1))
228
231
target_compile_options (openxr_loader PRIVATE -Wimplicit-fallthrough=0)
229
232
endif ()
230
233
endif ()
234
+ if (BUILD_WITHOUT_STD_FILESYSTEM)
235
+ target_compile_definitions (openxr_loader PRIVATE DISABLE_STD_FILESYSTEM)
236
+ endif ()
231
237
232
238
install (
233
239
TARGETS openxr_loader
You can’t perform that action at this time.
0 commit comments