From a41ae8d9b7c55a0396bf354bdc1925bdb392873a Mon Sep 17 00:00:00 2001 From: maier Date: Mon, 11 Mar 2013 18:16:01 +0000 Subject: [PATCH] CMake: Rename DEAL_II_CAN_USE_CXX1X with DEAL_II_CAN_USECXX11, provide a compatibility define in config.h.in git-svn-id: https://svn.dealii.org/trunk@28855 0785d39b-7218-0410-832d-ea1e28bc413d --- .../cmake/checks/check_01_cxx_features.cmake | 74 +++++++++---------- deal.II/include/deal.II/base/config.h.in | 5 +- .../include/deal.II/base/std_cxx1x/array.h | 2 +- deal.II/include/deal.II/base/std_cxx1x/bind.h | 2 +- .../base/std_cxx1x/condition_variable.h | 2 +- .../include/deal.II/base/std_cxx1x/function.h | 2 +- .../include/deal.II/base/std_cxx1x/mutex.h | 2 +- .../deal.II/base/std_cxx1x/shared_ptr.h | 2 +- .../include/deal.II/base/std_cxx1x/thread.h | 2 +- .../include/deal.II/base/std_cxx1x/tuple.h | 2 +- .../deal.II/base/std_cxx1x/type_traits.h | 2 +- 11 files changed, 50 insertions(+), 47 deletions(-) diff --git a/deal.II/cmake/checks/check_01_cxx_features.cmake b/deal.II/cmake/checks/check_01_cxx_features.cmake index 6e4b497a91..803fb4abec 100644 --- a/deal.II/cmake/checks/check_01_cxx_features.cmake +++ b/deal.II/cmake/checks/check_01_cxx_features.cmake @@ -19,7 +19,6 @@ # # DEAL_II_HAVE_CXX11_FLAG # DEAL_II_CXX11_FLAG -# DEAL_II_CAN_USE_CXX1X # DEAL_II_CAN_USE_CXX11 # HAVE_ISNAN # HAVE_UNDERSCORE_ISNAN @@ -164,7 +163,6 @@ IF(DEAL_II_HAVE_CXX11_FLAG) MESSAGE(STATUS "Sufficient C++11 support. Enabling ${DEAL_II_CXX11_FLAG}.") - SET(DEAL_II_CAN_USE_CXX1X TRUE) # TODO SET(DEAL_II_CAN_USE_CXX11 TRUE) ADD_FLAGS(CMAKE_CXX_FLAGS "${DEAL_II_CXX11_FLAG}") @@ -173,41 +171,43 @@ IF(DEAL_II_HAVE_CXX11_FLAG) MESSAGE(STATUS "Insufficient C++11 support. Disabling ${DEAL_II_CXX11_FLAG}.") ENDIF() - - IF(DEAL_II_CAN_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. :-] - # - - CHECK_CXX_SOURCE_COMPILES( - " - #include - std::vector v; - int main(){ auto i = v.begin(); *i; return 0;} - " - DEAL_II_HAVE_CXX11_AUTO_TYPE) - - CHECK_CXX_SOURCE_COMPILES( - " - #include ], - std::vector v; - int main(){ for (std::vector::iterator i : v) *i; return 0;} - " - DEAL_II_HAVE_CXX11_RANGE_BASED_FOR) - - IF( DEAL_II_HAVE_CXX11_AUTO_TYPE AND - DEAL_II_HAVE_CXX11_RANGE_BASED_FOR ) - - MESSAGE(STATUS "Additional C++11 support available.") - - SET(DEAL_II_CAN_USE_ADDITIONAL_CXX1X_FEATURES) - - ENDIF() - ENDIF() +# +# Currently unused +# +# IF(DEAL_II_CAN_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. :-] +# # +# +# CHECK_CXX_SOURCE_COMPILES( +# " +# #include +# std::vector v; +# int main(){ auto i = v.begin(); *i; return 0;} +# " +# DEAL_II_HAVE_CXX11_AUTO_TYPE) +# +# CHECK_CXX_SOURCE_COMPILES( +# " +# #include ], +# std::vector v; +# int main(){ for (std::vector::iterator i : v) *i; return 0;} +# " +# DEAL_II_HAVE_CXX11_RANGE_BASED_FOR) +# +# IF( DEAL_II_HAVE_CXX11_AUTO_TYPE AND +# DEAL_II_HAVE_CXX11_RANGE_BASED_FOR ) +# +# MESSAGE(STATUS "Additional C++11 support available.") +# +# SET(DEAL_II_CAN_USE_ADDITIONAL_CXX1X_FEATURES) +# ENDIF() +# +# ENDIF() POP_TEST_FLAG() diff --git a/deal.II/include/deal.II/base/config.h.in b/deal.II/include/deal.II/base/config.h.in index 713509f711..9e2960ad17 100644 --- a/deal.II/include/deal.II/base/config.h.in +++ b/deal.II/include/deal.II/base/config.h.in @@ -111,7 +111,10 @@ * to allow using the standard library classes instead of the corresponding * BOOST classes. */ -#cmakedefine DEAL_II_CAN_USE_CXX1X +#cmakedefine DEAL_II_CAN_USE_CXX11 +#ifdef DEAL_II_CAN_USE_CXX11 +# define DEAL_II_CAN_USE_CXX1X +#endif /* Defined if isnan is available */ #cmakedefine HAVE_ISNAN diff --git a/deal.II/include/deal.II/base/std_cxx1x/array.h b/deal.II/include/deal.II/base/std_cxx1x/array.h index 53797cc183..b9e7a72f8b 100644 --- a/deal.II/include/deal.II/base/std_cxx1x/array.h +++ b/deal.II/include/deal.II/base/std_cxx1x/array.h @@ -16,7 +16,7 @@ #include -#ifdef DEAL_II_CAN_USE_CXX1X +#ifdef DEAL_II_CAN_USE_CXX11 # include DEAL_II_NAMESPACE_OPEN diff --git a/deal.II/include/deal.II/base/std_cxx1x/bind.h b/deal.II/include/deal.II/base/std_cxx1x/bind.h index 8cf368b807..49979bef2e 100644 --- a/deal.II/include/deal.II/base/std_cxx1x/bind.h +++ b/deal.II/include/deal.II/base/std_cxx1x/bind.h @@ -16,7 +16,7 @@ #include -#ifdef DEAL_II_CAN_USE_CXX1X +#ifdef DEAL_II_CAN_USE_CXX11 # include diff --git a/deal.II/include/deal.II/base/std_cxx1x/condition_variable.h b/deal.II/include/deal.II/base/std_cxx1x/condition_variable.h index 6cc7125205..b439d5c91a 100644 --- a/deal.II/include/deal.II/base/std_cxx1x/condition_variable.h +++ b/deal.II/include/deal.II/base/std_cxx1x/condition_variable.h @@ -16,7 +16,7 @@ #include -#ifdef DEAL_II_CAN_USE_CXX1X +#ifdef DEAL_II_CAN_USE_CXX11 # include DEAL_II_NAMESPACE_OPEN diff --git a/deal.II/include/deal.II/base/std_cxx1x/function.h b/deal.II/include/deal.II/base/std_cxx1x/function.h index 8140fa1c7e..18f807e499 100644 --- a/deal.II/include/deal.II/base/std_cxx1x/function.h +++ b/deal.II/include/deal.II/base/std_cxx1x/function.h @@ -16,7 +16,7 @@ #include -#ifdef DEAL_II_CAN_USE_CXX1X +#ifdef DEAL_II_CAN_USE_CXX11 # include DEAL_II_NAMESPACE_OPEN diff --git a/deal.II/include/deal.II/base/std_cxx1x/mutex.h b/deal.II/include/deal.II/base/std_cxx1x/mutex.h index d58330ae00..df5652a4be 100644 --- a/deal.II/include/deal.II/base/std_cxx1x/mutex.h +++ b/deal.II/include/deal.II/base/std_cxx1x/mutex.h @@ -16,7 +16,7 @@ #include -#ifdef DEAL_II_CAN_USE_CXX1X +#ifdef DEAL_II_CAN_USE_CXX11 # include DEAL_II_NAMESPACE_OPEN diff --git a/deal.II/include/deal.II/base/std_cxx1x/shared_ptr.h b/deal.II/include/deal.II/base/std_cxx1x/shared_ptr.h index 71a784d359..9babfec48e 100644 --- a/deal.II/include/deal.II/base/std_cxx1x/shared_ptr.h +++ b/deal.II/include/deal.II/base/std_cxx1x/shared_ptr.h @@ -16,7 +16,7 @@ #include -#ifdef DEAL_II_CAN_USE_CXX1X +#ifdef DEAL_II_CAN_USE_CXX11 # include DEAL_II_NAMESPACE_OPEN diff --git a/deal.II/include/deal.II/base/std_cxx1x/thread.h b/deal.II/include/deal.II/base/std_cxx1x/thread.h index f471d8d0e8..bcbc1c5dfa 100644 --- a/deal.II/include/deal.II/base/std_cxx1x/thread.h +++ b/deal.II/include/deal.II/base/std_cxx1x/thread.h @@ -16,7 +16,7 @@ #include -#ifdef DEAL_II_CAN_USE_CXX1X +#ifdef DEAL_II_CAN_USE_CXX11 # include DEAL_II_NAMESPACE_OPEN diff --git a/deal.II/include/deal.II/base/std_cxx1x/tuple.h b/deal.II/include/deal.II/base/std_cxx1x/tuple.h index 293c1a45b9..4bcf46951f 100644 --- a/deal.II/include/deal.II/base/std_cxx1x/tuple.h +++ b/deal.II/include/deal.II/base/std_cxx1x/tuple.h @@ -16,7 +16,7 @@ #include -#ifdef DEAL_II_CAN_USE_CXX1X +#ifdef DEAL_II_CAN_USE_CXX11 # include DEAL_II_NAMESPACE_OPEN diff --git a/deal.II/include/deal.II/base/std_cxx1x/type_traits.h b/deal.II/include/deal.II/base/std_cxx1x/type_traits.h index 09b5a3d602..31bceaaf67 100644 --- a/deal.II/include/deal.II/base/std_cxx1x/type_traits.h +++ b/deal.II/include/deal.II/base/std_cxx1x/type_traits.h @@ -16,7 +16,7 @@ #include -#ifdef DEAL_II_CAN_USE_CXX1X +#ifdef DEAL_II_CAN_USE_CXX11 # include DEAL_II_NAMESPACE_OPEN -- 2.39.5