nc_cxx: actually allow the empty library for stdfs detection

This commit is contained in:
Danny Robson 2019-06-28 10:24:23 +10:00
parent 1dd0984040
commit 00955b8920

View File

@ -42,22 +42,22 @@ append_compile_flag ("-stdlib=libc++")
# discovered. # discovered.
if (NOT DEFINED __nc_cxx_stdcxxfs) if (NOT DEFINED __nc_cxx_stdcxxfs)
foreach(lib "" "c++fs" "c++experimental" "stdc++fs") foreach(lib "" "c++fs" "c++experimental" "stdc++fs")
if (NOT __nc_cxx_stdcxxfs) message (STATUS "Trying c++fs library '${lib}'")
message (STATUS "Trying c++fs library '${lib}'") try_compile(
try_compile( __nc_cxx_stdcxxfs ${CMAKE_CURRENT_BINARY_DIR}
__nc_cxx_stdcxxfs ${CMAKE_CURRENT_BINARY_DIR} SOURCES
SOURCES ${NC_CMAKE_BASE}/nc_cxx_stdcxxfs.cpp
${NC_CMAKE_BASE}/nc_cxx_stdcxxfs.cpp LINK_LIBRARIES
LINK_LIBRARIES ${lib}
${lib}) )
if (__nc_cxx_stdcxxfs) if (__nc_cxx_stdcxxfs)
set (__nc_cxx_stdcxxfs "${lib}" CACHE INTERNAL "library required for c++ filesystem") set (__nc_cxx_stdcxxfs "${lib}" CACHE INTERNAL "library required for c++ filesystem")
endif () break ()
endif () endif ()
endforeach() endforeach()
if (NOT __nc_cxx_stdcxxfs) if (NOT DEFINED __nc_cxx_stdcxxfs)
message (FATAL_ERROR "Could not locate the required c++fs library") message (FATAL_ERROR "Could not locate the required c++fs library")
endif () endif ()