From: Matthias Maier Date: Mon, 3 Jul 2023 05:09:44 +0000 (-0500) Subject: CMake: fix caching of C++ language feature checks X-Git-Tag: relicensing~779^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81b0207a93c94e1ec5faecf68fa232a2ff9ac0c5;p=dealii.git 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. --- 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}")