Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2021-04-15 13:45:51 +0300
committerNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2021-04-15 13:45:51 +0300
commit6735fabda8723111d687cc6bab54e73fad666131 (patch)
tree5439a37f52239a529c503b0d30e083ca3c24f572
parentdb383d69b71ae5dab99e8e90699629c1a684f4ee (diff)
Maybe partially fix issue #76 where CMAKE_CXX_STANDARD wasn't affecting probes for <filesystem>.
-rw-r--r--CMakeLists.txt18
1 files changed, 14 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index aa6e8d20..4293966f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -156,15 +156,18 @@ if(NOT MSVC OR CMAKE_VERSION VERSION_GREATER 3.59)
cxx_variable_templates
)
endif()
+set(check_cxx_source_linkage_flags)
# If on VS2019 16.3 or later, or on Apple, we require C++ 17
if((MSVC AND MSVC_VERSION VERSION_GREATER_EQUAL 1923) OR APPLE)
all_compile_features(PUBLIC
cxx_std_17
)
- if(MSVC)
- set(check_cxx_source_linkage_flags /std:c++17)
- else()
- set(check_cxx_source_linkage_flags -std=c++17)
+ if(NOT CMAKE_CXX_STANDARD)
+ if(MSVC)
+ set(check_cxx_source_linkage_flags /std:c++17)
+ else()
+ set(check_cxx_source_linkage_flags -std=c++17)
+ endif()
endif()
endif()
# Set the library dependencies this library has
@@ -184,6 +187,13 @@ function(check_cxx_source_linkage prog var)
if(MSVC AND CMAKE_GENERATOR MATCHES "Ninja")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} /EHsc")
endif()
+ if(CMAKE_CXX_STANDARD)
+ if(MSVC)
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} /std:c++${CMAKE_CXX_STANDARD}")
+ else()
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=c++${CMAKE_CXX_STANDARD}")
+ endif()
+ endif()
if(CMAKE_SYSTEM_PROCESSOR STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR} AND NOT LLFIO_ASSUME_CROSS_COMPILING)
check_cxx_source_runs("${prog}" ${var})
else()