Fix build when not file system library required
This commit is contained in:
parent
c701fc25ee
commit
d9b4ca5381
|
@ -157,7 +157,6 @@ else ()
|
|||
endif ()
|
||||
|
||||
# configure required libraries for std::filestream
|
||||
message(STATUS "calling use_filesystem()")
|
||||
use_standard_filesystem()
|
||||
|
||||
# configure forcing UTF-8 code page under Windows
|
||||
|
|
|
@ -285,9 +285,11 @@ function (use_standard_filesystem)
|
|||
set(REQUIRED_LIBRARY FAILED)
|
||||
set(INDEX 0)
|
||||
foreach (LIBRARY "" "stdc++fs" "c++fs")
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${DEFAULT_REQUIRED_LIBRARIES} -l${LIBRARY})
|
||||
check_cxx_source_compiles("${TEST_PROGRAM}" COULD_COMPILE_${INDEX})
|
||||
if (COULD_COMPILE_${INDEX})
|
||||
if (NOT LIBRARY STREQUAL "")
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${DEFAULT_REQUIRED_LIBRARIES} -l${LIBRARY})
|
||||
endif ()
|
||||
check_cxx_source_compiles("${TEST_PROGRAM}" COULD_COMPILE_TEST_PROGRAM_${INDEX})
|
||||
if (COULD_COMPILE_TEST_PROGRAM_${INDEX})
|
||||
set(REQUIRED_LIBRARY "${LIBRARY}")
|
||||
break()
|
||||
endif ()
|
||||
|
|
Loading…
Reference in New Issue