From: Matthias Maier Date: Sun, 6 May 2018 17:23:50 +0000 (-0500) Subject: CMake: Unset cached results for C++11/14/17 detection if necessary X-Git-Tag: v9.1.0-rc1~1201^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6498%2Fhead;p=dealii.git CMake: Unset cached results for C++11/14/17 detection if necessary --- diff --git a/cmake/checks/check_01_cxx_features.cmake b/cmake/checks/check_01_cxx_features.cmake index 7a7680aef2..139673ac3f 100644 --- a/cmake/checks/check_01_cxx_features.cmake +++ b/cmake/checks/check_01_cxx_features.cmake @@ -126,6 +126,11 @@ IF(NOT DEFINED DEAL_II_WITH_CXX17 OR DEAL_II_WITH_CXX17) PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}") PUSH_CMAKE_REQUIRED("-Werror") + UNSET_IF_CHANGED(CHECK_CXX_FEATURES_FLAGS_CXX17_SAVED + "${CMAKE_REQUIRED_FLAGS}${DEAL_II_CXX_VERSION_FLAG}" + DEAL_II_HAVE_CXX17_ATTRIBUTES + ) + # # Test that the c++17 attributes are supported. # @@ -176,6 +181,14 @@ IF(NOT DEFINED DEAL_II_WITH_CXX14 OR DEAL_II_WITH_CXX14) _check_version("14" "1y") IF(NOT "${DEAL_II_CXX_VERSION_FLAG}" STREQUAL "") + + UNSET_IF_CHANGED(CHECK_CXX_FEATURES_FLAGS_CXX14_SAVED + "${CMAKE_REQUIRED_FLAGS}${DEAL_II_CXX_VERSION_FLAG}" + DEAL_II_HAVE_CXX14_CLANGAUTODEBUG_BUG_OK + DEAL_II_HAVE_CXX14_CONSTEXPR_STDMAXMIN + DEAL_II_HAVE_CXX14_MAKE_UNIQUE + ) + # Set CMAKE_REQUIRED_FLAGS for the unit tests PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}") @@ -256,6 +269,15 @@ IF("${DEAL_II_CXX_VERSION_FLAG}" STREQUAL "") _check_version("11" "0x") ENDIF() +UNSET_IF_CHANGED(CHECK_CXX_FEATURES_FLAGS_CXX11_SAVED + "${CMAKE_REQUIRED_FLAGS}${DEAL_II_CXX_VERSION_FLAG}" + DEAL_II_HAVE_CXX11_FEATURES + DEAL_II_HAVE_CXX11_FUNCTIONAL_LLVMBUG20084_OK + DEAL_II_HAVE_CXX11_ICCLIBSTDCPP47CXX11BUG_OK + DEAL_II_HAVE_CXX11_ICCNUMERICLIMITSBUG_OK + DEAL_II_HAVE_CXX11_MACOSXC99BUG_OK + ) + PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}") CHECK_CXX_SOURCE_COMPILES( "