Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: add DEAL_II_CGAL_HAS_DEPRECATED_BOOST_INCLUDES check #13927

Merged
merged 2 commits into from
Jun 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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