]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Simplify clang configuration 815/head
authorMatthias Maier <matthias.maier@iwr.uni-heidelberg.de>
Thu, 16 Apr 2015 14:31:41 +0000 (16:31 +0200)
committerMatthias Maier <matthias.maier@iwr.uni-heidelberg.de>
Thu, 16 Apr 2015 17:09:53 +0000 (19:09 +0200)
It turns out that clang went a long way since 2011/2012. Remove unneeded
-Wno-* switches.

cmake/configure/configure_boost.cmake
cmake/setup_compiler_flags_gnu.cmake

index 7e68bde107a7d2bdd73bc5a6804eb30dffe8a9f0..0460eaa7aba1378731d32ad748cc6ae9f8a067f1 100644 (file)
@@ -22,28 +22,6 @@ SET(DEAL_II_WITH_BOOST ON # Always true. We need it :-]
   )
 
 
-MACRO(SET_UP_BOOST_FLAGS)
-  #
-  # Newer versions of gcc have a flag -Wunused-local-typedefs that, though in
-  # principle a good idea, triggers a lot in BOOST in various places.
-  # Unfortunately, this warning is included in -W/-Wall, so disable it if the
-  # compiler supports it.
-  #
-  ENABLE_IF_SUPPORTED(BOOST_CXX_FLAGS "-Wno-unused-local-typedefs")
-
-  IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-    # not harmless but needed for boost <1.50.0
-    ENABLE_IF_SUPPORTED(BOOST_CXX_FLAGS "-Wno-delete-non-virtual-dtor")
-
-    # suppress warnings in boost 1.56:
-    ENABLE_IF_SUPPORTED(BOOST_CXX_FLAGS "-Wno-c++11-extensions")
-    ENABLE_IF_SUPPORTED(BOOST_CXX_FLAGS "-Wno-c99-extensions")
-    ENABLE_IF_SUPPORTED(BOOST_CXX_FLAGS "-Wno-unused-parameter")
-    ENABLE_IF_SUPPORTED(BOOST_CXX_FLAGS "-Wno-variadic-macros")
-  ENDIF()
-ENDMACRO()
-
-
 MACRO(FEATURE_BOOST_CONFIGURE_BUNDLED)
   #
   # Add rt to the link interface as well, boost/chrono needs it.
@@ -54,14 +32,14 @@ MACRO(FEATURE_BOOST_CONFIGURE_BUNDLED)
     SET(BOOST_LIBRARIES ${rt_LIBRARY})
   ENDIF()
 
-  SET_UP_BOOST_FLAGS()
+  ENABLE_IF_SUPPORTED(BOOST_CXX_FLAGS "-Wno-unused-local-typedefs")
 
   SET(BOOST_BUNDLED_INCLUDE_DIRS ${BOOST_FOLDER}/include)
 ENDMACRO()
 
 
 MACRO(FEATURE_BOOST_CONFIGURE_EXTERNAL)
-  SET_UP_BOOST_FLAGS()
+  ENABLE_IF_SUPPORTED(BOOST_CXX_FLAGS "-Wno-unused-local-typedefs")
 ENDMACRO()
 
 
index 850250b8e3527aad4814edccbfec45f2bf52d852..c14ce7a6a21a00c15ad1e12dbe42880a4ec6f9a1 100644 (file)
@@ -78,7 +78,6 @@ ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-deprecated")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-deprecated-declarations")
 
 IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-
   #
   # Silence Clang warnings about unused compiler parameters (works around a
   # regression in the clang driver frontend of certain versions):
@@ -86,18 +85,21 @@ IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
   ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Qunused-arguments")
 
   #
-  # *Boy*, clang seems to be the very definition of "pedantic" in
-  # "-pedantic" mode, so disable a bunch of harmless warnings
-  # (that are mainly triggered in third party headers so that we cannot
-  # easily fix them...)
+  # Clang verbosely warns about not supporting all our friend declarations
+  # (and consequently removing access control alltogether)
   #
-  ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-dangling-else")
-  ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-long-long")
-  ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-newline-eof")
   ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-unsupported-friend")
-  ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-unused-function")
-  ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-unused-private-field")
+
+  ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-unused-parameter")
   ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-unused-variable")
+
+  IF(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.6")
+    #
+    # Clang versions prior to 3.6 emit a lot of false positives wrt
+    # "-Wunused-function".
+    #
+    ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-unused-function")
+  ENDIF()
 ENDIF()
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.