+
#
# Check for various compiler features.
#
# to make sure that we match the exception specification
# correctly.
#
-#include <cstdlib>
-CHECK_CXX_SOURCE_COMPILES(
+# (Yes. It is not a bug. But the logic is the same.)
+CHECK_CXX_COMPILER_BUG(
"
- extern \\"C\\" void abort () { for(;;) ; }
+ #include <cstdlib>
+ extern \"C\" void abort () { for(;;) ; }
int main(){ return 0; }
"
- DEAL_II_ABORT_WITHOUT_NOTHROW_EXCEPTION)
-
-IF(DEAL_II_ABORT_WITHOUT_NOTHROW_EXCEPTION)
- SET(DEAL_II_ABORT_NOTHROW_EXCEPTION TRUE)
-ENDIF()
+ DEAL_II_ABORT_NOTHROW_EXCEPTION)
HAVE_STD_IOSFWD_HEADER)
-
-
#
# C++11 Support:
#
-
+#
# See if there is a compiler flag to enable C++11 features
-# (Only test for -std=c++0x for the moment.)
#
-# TODO: We should also check for -std=c++11.
-CHECK_CXX_COMPILER_FLAG(
- "-std=c++0x"
- DEAL_II_HAVE_CXX11_FLAG)
-
+FOREACH(test_flag
+ "-std=c++11"
+ "-std=c++-x"
+ )
+ SET(flag ${test_flag})
+ CHECK_CXX_COMPILER_FLAG("${test_flag}" DEAL_II_HAVE_CXX11_FLAG)
+ IF(DEAL_II_HAVE_CXX11_FLAG)
+ BREAK()
+ ENDIF()
+ENDFOREACH()
IF(DEAL_II_HAVE_CXX11_FLAG)
# Set CMAKE_REQUIRED_FLAGS for the unit tests
- ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-std=c++0x")
+ ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${flag}")
CHECK_CXX_SOURCE_COMPILES(
"
DEAL_II_HAVE_CXX11_TUPLE AND
DEAL_II_HAVE_CXX11_TYPE_TRAITS )
- MESSAGE(STATUS "Sufficient C++11 support. Enabling -std=c++0x.")
+ MESSAGE(STATUS "Sufficient C++11 support. Enabling ${flag}.")
SET(DEAL_II_CAN_USE_CXX1X TRUE) # TODO
SET(DEAL_II_CAN_USE_CXX11 TRUE)
- ADD_FLAGS(CMAKE_CXX_FLAGS "-std=c++0x")
+ ADD_FLAGS(CMAKE_CXX_FLAGS "${flag}")
ELSE()
- MESSAGE(STATUS "Insufficient C++11 support. Disabling -std=c++0x.")
+ MESSAGE(STATUS "Insufficient C++11 support. Disabling ${flag}.")
ENDIF()
IF(DEAL_II_CAN_USE_CXX11)
ENDIF()
ENDIF()
- STRIP_FLAG(CMAKE_REQUIRED_FLAGS "-std=c++0x")
+ STRIP_FLAG(CMAKE_REQUIRED_FLAGS "${flag}")
ELSE()
- MESSAGE(STATUS "Insufficient C++11 support. Disabling -std=c++0x.")
+ MESSAGE(STATUS "Insufficient C++11 support. Disabling ${flag}.")
ENDIF()
#
-# Checks for various header files: # TODO: Obsolete?
+# Checks for various header files:
#
CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H)