]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: add a configure check for spurious boost deprecation warnings
authorMatthias Maier <tamiko@43-1.org>
Wed, 1 Dec 2021 03:18:11 +0000 (21:18 -0600)
committerMatthias Maier <tamiko@43-1.org>
Wed, 1 Dec 2021 03:45:05 +0000 (21:45 -0600)
cmake/configure/configure_2_boost.cmake
include/deal.II/base/config.h.in

index cc9dcb4c7e965fbd61afe57767c6d021258680ba..b61c7a64d5a54dc3ff388bf9f74ad343e9c6dc57 100644 (file)
@@ -74,6 +74,26 @@ MACRO(FEATURE_BOOST_CONFIGURE_COMMON)
   ENDIF()
 
   ENABLE_IF_SUPPORTED(BOOST_CXX_FLAGS "-Wno-unused-local-typedefs")
+
+  # At least BOOST 1.74 has the problem that some of the BOOST headers
+  # include other BOOST headers that are deprecated, and this then leads to
+  # warnings. That's rather annoying.
+
+  # The configure function is called only once. In case an externally provided
+  # boost library is detected, BOOST_INCLUDE_DIRS contains the include paths to
+  # be used and BOOST_BUNDLED_INCLUDE_DIRS is empty. For the bundled library, it
+  # is the other way around.
+  LIST(APPEND CMAKE_REQUIRED_INCLUDES ${BOOST_INCLUDE_DIRS} ${BOOST_BUNDLED_INCLUDE_DIRS})
+
+  CHECK_CXX_COMPILER_BUG(
+    "
+    #define BOOST_CONFIG_HEADER_DEPRECATED_HPP_INCLUDED
+    #define BOOST_HEADER_DEPRECATED(a) _Pragma(\"GCC error \\\"stop compilation\\\"\");
+    #include <boost/geometry/index/rtree.hpp>
+    int main() { return 0; }
+    "
+    DEAL_II_BOOST_HAS_BROKEN_HEADER_DEPRECATIONS)
+  RESET_CMAKE_REQUIRED()
 ENDMACRO()
 
 
index a5d1b71519f80524fa69d97025bf81d1c0b5a9d5..4c549dff74f617678eccaa8f33c53bdb7b6ecc98 100644 (file)
 /* cmake/modules/FindSYMENGINE.cmake */
 #cmakedefine DEAL_II_SYMENGINE_WITH_LLVM
 
+/* cmake/configure/configure_2_boost.cmake */
+#cmakedefine DEAL_II_BOOST_HAS_BROKEN_HEADER_DEPRECATIONS
+
 /* cmake/configure/configure_2_trilinos.cmake */
 #cmakedefine DEAL_II_TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD
 #cmakedefine DEAL_II_TRILINOS_WITH_EPETRAEXT

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.