cxx: disable filesystem library discovery

This commit is contained in:
Danny Robson 2019-10-22 12:00:50 +11:00
parent ff58436a98
commit 985fe7fe48

View File

@ -40,29 +40,29 @@ append_compile_flag ("-stdlib=libc++")
# hardcoded guess and doesn't respect _all_ the system paths; specifically # hardcoded guess and doesn't respect _all_ the system paths; specifically
# something like /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/libstdc++.so won't get # something like /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/libstdc++.so won't get
# 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")
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")
break () # break ()
endif () # endif ()
endforeach() # endforeach()
#
if (NOT DEFINED __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 ()
#
message (STATUS "Using c++fs library ${__nc_cxx_stdcxxfs}") # message (STATUS "Using c++fs library ${__nc_cxx_stdcxxfs}")
endif () #endif ()
set(NC_CXX_STDCXXFS ${__nc_cxx_stdcxxfs}) set(NC_CXX_STDCXXFS ${__nc_cxx_stdcxxfs})