File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -19,22 +19,17 @@ endif()
19
19
set (CMAKE_TRY_COMPILE_TARGET_TYPE EXECUTABLE )
20
20
21
21
# some compilers claim to have filesystem, but their libstdc++ doesn't have it.
22
- check_source_compiles (CXX
23
- [=[
24
- #include <filesystem>
25
-
22
+ set (_src "#include <filesystem>
26
23
int main () {
27
- std::filesystem::path tgt("a/b");
28
-
29
- return !tgt.has_filename();
30
- }
31
- ]=]
32
- HAVE_CXX_FILESYSTEM
33
- )
24
+ std::filesystem::pat2h tgt;
25
+ return tgt.empty() ? 0 : 1;
26
+ }" )
27
+ check_source_compiles (CXX "${_src} " HAVE_CXX_FILESYSTEM )
34
28
35
29
if (NOT HAVE_CXX_FILESYSTEM )
36
- message (WARNING "C++ stdlib filesystem is broken in libstdc++ ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}
37
- ${HAVE_CXX_FILESYSTEM} " )
30
+ message (STATUS "${PROJECT_NAME} : CMake ${CMAKE_VERSION} ${CMAKE_GENERATOR} proceeding with C++${CMAKE_CXX_STANDARD} fallback to <filesystem>: libstdc++ ${ffilesystem_stdcpp_version} compiler ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} linker: ${CMAKE_CXX_COMPILER_LINKER_ID} ${CMAKE_CXX_COMPILER_LINKER_VERSION}
31
+ ${HAVE_CXX_FILESYSTEM}
32
+ see CMake log file ${CMAKE_BINARY_DIR} /CMakeFiles/CMakeConfigureLog.yaml for details on variable HAVE_CXX_FILESYSTEM." )
38
33
return ()
39
34
endif ()
40
35
You can’t perform that action at this time.
0 commit comments