From 00955b89208306de707a38e83e0328bb54b36994 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Fri, 28 Jun 2019 10:24:23 +1000 Subject: [PATCH] nc_cxx: actually allow the empty library for stdfs detection --- nc_cxx.cmake | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/nc_cxx.cmake b/nc_cxx.cmake index f91b481..6549cd7 100644 --- a/nc_cxx.cmake +++ b/nc_cxx.cmake @@ -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}) + 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} + ) - if (__nc_cxx_stdcxxfs) - set (__nc_cxx_stdcxxfs "${lib}" CACHE INTERNAL "library required for c++ filesystem") - endif () + if (__nc_cxx_stdcxxfs) + set (__nc_cxx_stdcxxfs "${lib}" CACHE INTERNAL "library required for c++ filesystem") + 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 ()