]> https://gitweb.dealii.org/ - dealii.git/commitdiff
We indeed need to export TBB_IMPLEMENT_CPP0X=1 more freely. TODO: Is it
authorMatthias Maier <tamiko@kyomu.43-1.org>
Tue, 15 Oct 2013 10:31:54 +0000 (10:31 +0000)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Tue, 15 Oct 2013 10:31:54 +0000 (10:31 +0000)
safe to export TBB_IMPLEMENT_CPP0X for headers used from an external
library?

git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@31237 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/bundled/tbb41_20130401oss/src/CMakeLists.txt
deal.II/cmake/checks/check_01_cxx_features.cmake
deal.II/cmake/configure/configure_1_threads.cmake
deal.II/include/deal.II/base/config.h.in

index 96711a27e0e036e560eb9db055b2c06e532cca06..6e5c208abeee832b150bae2294d7b232ec66d8b0 100644 (file)
@@ -118,10 +118,3 @@ ELSE()
     DEAL_II_ADD_DEFINITIONS(obj_tbb "DO_ITT_NOTIFY")
   ENDIF()
 ENDIF()
-
-#
-# Workaround for clang to compile in C++11 mode:
-#
-IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-  DEAL_II_ADD_DEFINITIONS(obj_tbb "TBB_IMPLEMENT_CPP0X=1")
-ENDIF()
index e872415eb3789c5bc9aa7c724a357760fb93c9a5..84a9d178a210d9ec426cbac26b5f5ac80fda535d 100644 (file)
@@ -176,17 +176,15 @@ IF(DEAL_II_HAVE_CXX11_FLAG)
     MESSAGE(STATUS "Insufficient C++11 support. Disabling ${DEAL_II_CXX11_FLAG}.")
   ENDIF()
 
-#
-# Currently unused
-#
-#  IF(DEAL_II_USE_CXX11)
-#    #
-#    # Also test for a couple of C++11 things that we don't use in the
-#    # library but that users may want to use in their applications and that
-#    # we might want to test in the testsuite
-#    #
-#    # TODO: Actually we have to export the test results somehow. :-]
-#    #
+ IF(DEAL_II_USE_CXX11)
+   CHECK_CXX_SOURCE_COMPILES(
+     "
+     #include <type_traits>
+     int main(){ std::is_trivially_copyable<int> bob; }
+     "
+     DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE)
+
+# Currently unused:
 #
 #    CHECK_CXX_SOURCE_COMPILES(
 #      "
@@ -212,7 +210,7 @@ IF(DEAL_II_HAVE_CXX11_FLAG)
 #      SET(DEAL_II_CAN_USE_ADDITIONAL_CXX1X_FEATURES)
 #    ENDIF()
 #
-#  ENDIF()
+  ENDIF()
 
   POP_TEST_FLAG()
 
index e6ddef4076d247e70d8fd220ec643221459ab5a2..88c0737d5fb765b0dd97f30cb086b8d2a642a3d2 100644 (file)
@@ -22,7 +22,7 @@
 
 
 #
-# Set up genereal threading:
+# Set up general threading:
 # The macro will be included in CONFIGURE_FEATURE_THREADS_EXTERNAL/BUNDLED.
 #
 MACRO(SETUP_THREADING)
@@ -164,6 +164,16 @@ MACRO(FEATURE_THREADS_CONFIGURE_EXTERNAL)
 
   ENDIF()
 
+  #
+  # Workaround for an issue with C++11 mode, non gcc-compilers and missing
+  # template<typename T> std::ist_trivially_copyable<T>
+  #
+  IF( DEAL_II_USE_CXX11 AND
+      NOT DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE AND
+      NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU" )
+    LIST(APPEND DEAL_II_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1")
+  ENDIF()
+
 
   SETUP_THREADING()
 ENDMACRO()
@@ -190,6 +200,16 @@ MACRO(FEATURE_THREADS_CONFIGURE_BUNDLED)
       )
   ENDIF()
 
+  #
+  # Workaround for an issue with C++11 mode, non gcc-compilers and missing
+  # template<typename T> std::ist_trivially_copyable<T>
+  #
+  IF( DEAL_II_USE_CXX11 AND
+      NOT DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE AND
+      NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU" )
+    LIST(APPEND DEAL_II_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1")
+  ENDIF()
+
   #
   # tbb uses dlopen/dlclose, so link against libdl.so as well:
   #
index d033635bfd522cf4074a86f5d1b494bb771da978..8c5dba2a0de49ed9bdeb120f59422bf29b9950bf 100644 (file)
 # define DEAL_II_CAN_USE_CXX1X
 #endif
 
+/* Defined if C++11 is enabled and the standard library supports
+ * template<typename T> std::is_trivially_copyable<T>
+ */
+#cmakedefine DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE
+
 /* Defined if isnan is available */
 #cmakedefine HAVE_ISNAN
 

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.