diff options
author | Brad King <brad.king@kitware.com> | 2014-04-30 13:42:00 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-04-30 13:42:00 (GMT) |
commit | 8535d4cf5dbe1f48a7da7bece7e435a2bd412eee (patch) | |
tree | 1d777bb9a49e9a8f95efff1e8ab36aba1e3f7ec8 /Modules | |
parent | a676ced3464cb7bea7b26f9f2bf235f0e70c4145 (diff) | |
parent | a36b957fc4594264965a86b54e5eab40520cf79d (diff) | |
download | CMake-8535d4cf5dbe1f48a7da7bece7e435a2bd412eee.zip CMake-8535d4cf5dbe1f48a7da7bece7e435a2bd412eee.tar.gz CMake-8535d4cf5dbe1f48a7da7bece7e435a2bd412eee.tar.bz2 |
Merge topic 'cxx98-features'
a36b957f Features: Add cxx_template_template_parameters.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeCXXCompiler.cmake.in | 1 | ||||
-rw-r--r-- | Modules/CMakeDetermineCompileFeatures.cmake | 7 | ||||
-rw-r--r-- | Modules/Compiler/GNU-CXX-FeatureTests.cmake | 1 | ||||
-rw-r--r-- | Modules/Compiler/GNU-CXX.cmake | 4 |
4 files changed, 13 insertions, 0 deletions
diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in index fdee336..6e531ca 100644 --- a/Modules/CMakeCXXCompiler.cmake.in +++ b/Modules/CMakeCXXCompiler.cmake.in @@ -3,6 +3,7 @@ set(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@") set(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@") set(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@") set(CMAKE_CXX_COMPILE_FEATURES "@CMAKE_CXX_COMPILE_FEATURES@") +set(CMAKE_CXX98_COMPILE_FEATURES "@CMAKE_CXX98_COMPILE_FEATURES@") set(CMAKE_CXX11_COMPILE_FEATURES "@CMAKE_CXX11_COMPILE_FEATURES@") set(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@") diff --git a/Modules/CMakeDetermineCompileFeatures.cmake b/Modules/CMakeDetermineCompileFeatures.cmake index 40aa9d6..583ff8d 100644 --- a/Modules/CMakeDetermineCompileFeatures.cmake +++ b/Modules/CMakeDetermineCompileFeatures.cmake @@ -17,6 +17,7 @@ function(cmake_determine_compile_features lang) if(lang STREQUAL CXX AND COMMAND cmake_record_cxx_compile_features) message(STATUS "Detecting ${lang} compile features") + set(CMAKE_CXX98_COMPILE_FEATURES) set(CMAKE_CXX11_COMPILE_FEATURES) include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake") @@ -28,13 +29,19 @@ function(cmake_determine_compile_features lang) return() endif() + if (CMAKE_CXX98_COMPILE_FEATURES) + list(REMOVE_ITEM CMAKE_CXX11_COMPILE_FEATURES ${CMAKE_CXX98_COMPILE_FEATURES}) + endif() + if(NOT CMAKE_CXX_COMPILE_FEATURES) set(CMAKE_CXX_COMPILE_FEATURES + ${CMAKE_CXX98_COMPILE_FEATURES} ${CMAKE_CXX11_COMPILE_FEATURES} ) endif() set(CMAKE_CXX_COMPILE_FEATURES ${CMAKE_CXX_COMPILE_FEATURES} PARENT_SCOPE) + set(CMAKE_CXX98_COMPILE_FEATURES ${CMAKE_CXX98_COMPILE_FEATURES} PARENT_SCOPE) set(CMAKE_CXX11_COMPILE_FEATURES ${CMAKE_CXX11_COMPILE_FEATURES} PARENT_SCOPE) message(STATUS "Detecting ${lang} compile features - done") diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 3f169d2..fe0ff0b 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -74,4 +74,5 @@ set(_cmake_feature_test_cxx_extern_templates "${_oldestSupported} && __cplusplus # TODO: Should be supported forever? set(_cmake_feature_test_cxx_func_identifier "${_oldestSupported} && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_variadic_macros "${_oldestSupported} && __cplusplus >= 201103L") +set(_cmake_feature_test_cxx_template_template_parameters "${_oldestSupported} && __cplusplus >= 199711L") set(_oldestSupported) diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index 7acad52..6ec3958 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -27,10 +27,14 @@ endif() macro(cmake_record_cxx_compile_features) macro(_get_gcc_features std_version list) record_compiler_features(CXX "-std=${std_version}" ${list}) + if (NOT _result EQUAL 0) + return() + endif() endmacro() if (UNIX AND NOT APPLE AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) _get_gcc_features(c++11 CMAKE_CXX11_COMPILE_FEATURES) + _get_gcc_features(c++98 CMAKE_CXX98_COMPILE_FEATURES) else() set(_result 0) endif() |