Skip to content

Commit

Permalink
Merge pull request #13927 from tamiko/fix_compile_warnings_02
Browse files Browse the repository at this point in the history
CMake: add DEAL_II_CGAL_HAS_DEPRECATED_BOOST_INCLUDES check
  • Loading branch information
luca-heltai committed Jun 8, 2022
2 parents d8c4a5f + 458cfc1 commit 38cf3f5
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 14 deletions.
23 changes: 23 additions & 0 deletions cmake/configure/configure_50_cgal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,27 @@ MACRO(FEATURE_CGAL_FIND_EXTERNAL var)
ENDIF()
ENDMACRO()


MACRO(FEATURE_CGAL_CONFIGURE_EXTERNAL)
# Similarly to the DEAL_II_BOOST_HAS_BROKEN_HEADER_DEPRECATIONS check run
# in configure_20_boost.cmake we have to check whether cgal includes
# a deprecated boost header. If yes, disable the boost deprecated header
# warning as well.

LIST(APPEND CMAKE_REQUIRED_INCLUDES
${BOOST_INCLUDE_DIRS} ${BOOST_BUNDLED_INCLUDE_DIRS} ${CGAL_INCLUDE_DIRS}
)

CHECK_CXX_COMPILER_BUG(
"
#define BOOST_CONFIG_HEADER_DEPRECATED_HPP_INCLUDED
#define BOOST_HEADER_DEPRECATED(a) _Pragma(\"GCC error \\\"stop compilation\\\"\");
#include <CGAL/make_mesh_3.h>
int main() { return 0; }
"
DEAL_II_CGAL_HAS_DEPRECATED_BOOST_INCLUDES)

RESET_CMAKE_REQUIRED()
ENDMACRO()

CONFIGURE_FEATURE(CGAL)
6 changes: 0 additions & 6 deletions include/deal.II/base/bounding_box_data_out.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,8 @@
#include <deal.II/boost_adaptors/segment.h>

DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
#ifdef DEAL_II_BOOST_HAS_BROKEN_HEADER_DEPRECATIONS
# define BOOST_ALLOW_DEPRECATED_HEADERS
#endif
#include <boost/geometry/index/rtree.hpp>
#include <boost/geometry/strategies/strategies.hpp>
#ifdef DEAL_II_BOOST_HAS_BROKEN_HEADER_DEPRECATIONS
# undef BOOST_ALLOW_DEPRECATED_HEADERS
#endif
DEAL_II_ENABLE_EXTRA_DIAGNOSTICS


Expand Down
11 changes: 10 additions & 1 deletion include/deal.II/base/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,12 @@
/* cmake/modules/FindSYMENGINE.cmake */
#cmakedefine DEAL_II_SYMENGINE_WITH_LLVM

/* cmake/configure/configure_2_boost.cmake */
/* cmake/configure/configure_20_boost.cmake */
#cmakedefine DEAL_II_BOOST_HAS_BROKEN_HEADER_DEPRECATIONS

/* cmake/configure/configure_50_cgal.cmake */
#cmakedefine DEAL_II_CGAL_HAS_DEPRECATED_BOOST_INCLUDES

/* cmake/configure/configure_2_trilinos.cmake */
#cmakedefine DEAL_II_TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD
#cmakedefine DEAL_II_TRILINOS_WITH_EPETRAEXT
Expand All @@ -244,6 +247,12 @@
#cmakedefine DEAL_II_TRILINOS_WITH_TPETRA
#cmakedefine DEAL_II_TRILINOS_WITH_ZOLTAN

#if defined(DEAL_II_BOOST_HAS_BROKEN_HEADER_DEPRECATIONS) || \
defined(DEAL_II_CGAL_HAS_DEPRECATED_BOOST_INCLUDES)
# ifndef BOOST_ALLOW_DEPRECATED_HEADERS
# define BOOST_ALLOW_DEPRECATED_HEADERS
# endif
#endif

/***********************************************************************
* Various macros for version number query and comparison:
Expand Down
7 changes: 0 additions & 7 deletions include/deal.II/numerics/rtree.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,8 @@

DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
#include <boost/geometry/algorithms/distance.hpp>

#ifdef DEAL_II_BOOST_HAS_BROKEN_HEADER_DEPRECATIONS
# define BOOST_ALLOW_DEPRECATED_HEADERS
#endif
#include <boost/geometry/index/rtree.hpp>
#include <boost/geometry/strategies/strategies.hpp>
#ifdef DEAL_II_BOOST_HAS_BROKEN_HEADER_DEPRECATIONS
# undef BOOST_ALLOW_DEPRECATED_HEADERS
#endif
DEAL_II_ENABLE_EXTRA_DIAGNOSTICS

#include <memory>
Expand Down

0 comments on commit 38cf3f5

Please sign in to comment.