]> 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)
committerDavid Wells <drwells@email.unc.edu>
Thu, 6 Jan 2022 15:12:20 +0000 (10:12 -0500)
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 ad7a6e32ec3f825b6404b98dfc759e7753032c12..0d128e0bbab4819c7cd549ae11d44429bc4dfc73 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.