From 163a5aee564f22b7e963a8be120940a056851b3c Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Thu, 3 May 2018 16:08:40 -0400 Subject: [PATCH] reorder deprecation feature check This moves the check of compiler features after the std standard detection and checks that the checks compile with the correct flags to be used later without warnings. --- ...eatures.cmake => check_02_compiler_features.cmake} | 11 +++++++++++ 1 file changed, 11 insertions(+) rename cmake/checks/{check_01_compiler_features.cmake => check_02_compiler_features.cmake} (96%) diff --git a/cmake/checks/check_01_compiler_features.cmake b/cmake/checks/check_02_compiler_features.cmake similarity index 96% rename from cmake/checks/check_01_compiler_features.cmake rename to cmake/checks/check_02_compiler_features.cmake index e28afe5a70..9b25606212 100644 --- a/cmake/checks/check_01_compiler_features.cmake +++ b/cmake/checks/check_02_compiler_features.cmake @@ -315,6 +315,15 @@ ENDIF() # - Wolfgang Bangerth, 2012 # +# some compilers compile the attributes but they do not work: +# "warning: use of the 'deprecated' attribute is a C++14 extension" (clang in c++11 mode) +# "warning #1292: unknown attribute "deprecated"" (icc) +PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_FLAGS}") +PUSH_CMAKE_REQUIRED("-Werror") +PUSH_CMAKE_REQUIRED("-Wno-deprecated-declarations") +PUSH_CMAKE_REQUIRED("-Wno-deprecated") +PUSH_CMAKE_REQUIRED("-Wno-unused-command-line-argument") + # first see if the compiler accepts the attribute CHECK_CXX_SOURCE_COMPILES( " @@ -350,6 +359,8 @@ CHECK_CXX_SOURCE_COMPILES( DEAL_II_COMPILER_HAS_ATTRIBUTE_DEPRECATED ) +RESET_CMAKE_REQUIRED() + IF(DEAL_II_COMPILER_HAS_CXX14_ATTRIBUTE_DEPRECATED) SET(DEAL_II_DEPRECATED "[[deprecated]]") ELSEIF(DEAL_II_COMPILER_HAS_ATTRIBUTE_DEPRECATED) -- 2.39.5