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.
if (NOT DEFINED __nc_cxx_stdcxxfs)
foreach(lib "" "c++fs" "c++experimental" "stdc++fs")
if (NOT __nc_cxx_stdcxxfs)
message (STATUS "Trying c++fs library '${lib}'")
try_compile(
__nc_cxx_stdcxxfs ${CMAKE_CURRENT_BINARY_DIR}
SOURCES
${NC_CMAKE_BASE}/nc_cxx_stdcxxfs.cpp
LINK_LIBRARIES
${lib})
${lib}
)
if (__nc_cxx_stdcxxfs)
set (__nc_cxx_stdcxxfs "${lib}" CACHE INTERNAL "library required for c++ filesystem")
endif ()
break ()
endif ()
endforeach()
if (NOT __nc_cxx_stdcxxfs)
if (NOT DEFINED __nc_cxx_stdcxxfs)
message (FATAL_ERROR "Could not locate the required c++fs library")
endif ()