From: Timo Heister Date: Thu, 3 May 2018 20:08:40 +0000 (-0400) Subject: reorder deprecation feature check X-Git-Tag: v9.0.0-rc1~27^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=163a5aee564f22b7e963a8be120940a056851b3c;p=dealii.git 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. --- 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)