aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--cmake/EigenConfigureTesting.cmake11
-rw-r--r--cmake/EigenTesting.cmake6
-rw-r--r--unsupported/test/CMakeLists.txt1
4 files changed, 15 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 00287c9bb..13f9c8f9d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -321,7 +321,7 @@ if(EIGEN_TEST_NO_EXCEPTIONS)
message(STATUS "Disabling exceptions in tests/examples")
endif()
-option(EIGEN_TEST_C++0x "Enables all C++0x features." OFF)
+option(EIGEN_TEST_CXX11 "Enable testing with C++11 and C++11 features (e.g. Tensor module)." OFF)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
diff --git a/cmake/EigenConfigureTesting.cmake b/cmake/EigenConfigureTesting.cmake
index 737f77232..0ee484e8c 100644
--- a/cmake/EigenConfigureTesting.cmake
+++ b/cmake/EigenConfigureTesting.cmake
@@ -49,9 +49,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
else(EIGEN_COVERAGE_TESTING)
set(COVERAGE_FLAGS "")
endif(EIGEN_COVERAGE_TESTING)
- if(EIGEN_TEST_C++0x)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
- endif(EIGEN_TEST_C++0x)
+
if(CMAKE_SYSTEM_NAME MATCHES Linux)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_FLAGS} -g2")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COVERAGE_FLAGS} -O2 -g2")
@@ -61,3 +59,10 @@ if(CMAKE_COMPILER_IS_GNUCXX)
elseif(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS")
endif(CMAKE_COMPILER_IS_GNUCXX)
+
+
+check_cxx_compiler_flag("-std=c++11" EIGEN_COMPILER_SUPPORT_CXX11)
+
+if(EIGEN_TEST_CXX11 AND EIGEN_COMPILER_SUPPORT_CXX11)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+endif()
diff --git a/cmake/EigenTesting.cmake b/cmake/EigenTesting.cmake
index dc69f65aa..b4ab95dbc 100644
--- a/cmake/EigenTesting.cmake
+++ b/cmake/EigenTesting.cmake
@@ -299,6 +299,12 @@ macro(ei_testing_print_summary)
else()
message(STATUS "ARMv8 NEON: Using architecture defaults")
endif()
+
+ if(EIGEN_TEST_CXX11)
+ message(STATUS "C++11: ON")
+ else()
+ message(STATUS "C++11: OFF")
+ endif()
endif() # vectorization / alignment options
diff --git a/unsupported/test/CMakeLists.txt b/unsupported/test/CMakeLists.txt
index 7b6751f00..8542dd853 100644
--- a/unsupported/test/CMakeLists.txt
+++ b/unsupported/test/CMakeLists.txt
@@ -95,7 +95,6 @@ ei_add_test(minres)
ei_add_test(levenberg_marquardt)
ei_add_test(kronecker_product)
-option(EIGEN_TEST_CXX11 "Enable testing of C++11 features (e.g. Tensor module)." ON)
if(EIGEN_TEST_CXX11)
# It should be safe to always run these tests as there is some fallback code for
# older compiler that don't support cxx11.