]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Define BOOST_NO_CXX11_HDR_UNORDERED_MAP for bundled boost if <gcc-4.8
authorMatthias Maier <tamiko@43-1.org>
Thu, 12 Jan 2017 13:26:27 +0000 (07:26 -0600)
committerMatthias Maier <tamiko@43-1.org>
Thu, 12 Jan 2017 22:09:51 +0000 (16:09 -0600)
Closes #3624.

cmake/configure/configure_boost.cmake

index 1ffbd701a74b1f40e2bc328d63d489286da46101..45a88e60018e61dc5e3270650047baae32971210 100644 (file)
@@ -47,6 +47,19 @@ MACRO(FEATURE_BOOST_CONFIGURE_BUNDLED)
     LIST(APPEND BOOST_DEFINITIONS "BOOST_ALL_NO_LIB")
     LIST(APPEND BOOST_USER_DEFINITIONS "BOOST_ALL_NO_LIB")
   ENDIF()
+
+  #
+  # Our bundled boost version 1.62 checks for the availability of
+  # "emplace_hint" incorrectly. Thus, simply define
+  # BOOST_NO_CXX11_HDR_UNORDERED_MAP if the gcc compiler version is less
+  # than 4.8.
+  #
+  IF( CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND
+      CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8" )
+    LIST(APPEND BOOST_DEFINITIONS "BOOST_NO_CXX11_HDR_UNORDERED_MAP")
+    LIST(APPEND BOOST_USER_DEFINITIONS "BOOST_NO_CXX11_HDR_UNORDERED_MAP")
+  ENDIF()
+
 ENDMACRO()
 
 MACRO(FEATURE_BOOST_FIND_EXTERNAL var)
@@ -63,6 +76,17 @@ MACRO(FEATURE_BOOST_FIND_EXTERNAL var)
       MESSAGE(STATUS "Boost version 1.58 is not compatible with deal.II!")
       SET(${var} FALSE)
     ENDIF()
+
+    #
+    # Newer boost versions check for the availability of "emplace_hint"
+    # incorrectly. Thus, simply define BOOST_NO_CXX11_HDR_UNORDERED_MAP if
+    # the gcc compiler version is less than 4.8.
+    #
+    IF( CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND
+        CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8" )
+      LIST(APPEND BOOST_DEFINITIONS "BOOST_NO_CXX11_HDR_UNORDERED_MAP")
+      LIST(APPEND BOOST_USER_DEFINITIONS "BOOST_NO_CXX11_HDR_UNORDERED_MAP")
+    ENDIF()
   ENDIF()
 ENDMACRO()
 

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.