Browse Source

Fix build when not file system library required

sendfile
Martchus 3 years ago
parent
commit
d9b4ca5381
  1. 1
      CMakeLists.txt
  2. 8
      cmake/modules/3rdParty.cmake

1
CMakeLists.txt

@ -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

8
cmake/modules/3rdParty.cmake

@ -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…
Cancel
Save