From 81b0207a93c94e1ec5faecf68fa232a2ff9ac0c5 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Mon, 3 Jul 2023 00:09:44 -0500 Subject: [PATCH] CMake: fix caching of C++ language feature checks Fix some issues with the recent refactoring for C++17. In particular, we have to be careful not to accidentally rerun all of these checks on every (re)configure. --- cmake/checks/check_01_cxx_features.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/checks/check_01_cxx_features.cmake b/cmake/checks/check_01_cxx_features.cmake index bc7f269966..da8701b5c8 100644 --- a/cmake/checks/check_01_cxx_features.cmake +++ b/cmake/checks/check_01_cxx_features.cmake @@ -242,6 +242,7 @@ macro(_test_cxx17_support) } " DEAL_II_HAVE_CXX14_CLANGAUTODEBUG_BUG_OK) + _set_up_cmake_required() # Check some generic C++11 features CHECK_CXX_SOURCE_COMPILES( @@ -307,9 +308,9 @@ endmacro() _set_up_cmake_required() _test_cxx17_support() -if(NOT DEAL_II_HAVE_CXX14) +if(NOT DEAL_II_HAVE_CXX17) # - # We failed to detect C++14 support. Let's make an attempt to set the + # We failed to detect C++17 support. Let's make an attempt to set the # -std= compiler flag. (But in order to minimize confusion let's not # override any manually specified -std= flag or CMAKE_CXX_STANDARD # variable set by the user.) @@ -333,7 +334,6 @@ if(NOT DEAL_II_HAVE_CXX17) ) endif() -_test_cxx17_support() _test_cxx20_support() set_if_empty(CMAKE_CXX_STANDARD "${_cxx_standard}") -- 2.39.5