diff options
author | Brad King <brad.king@kitware.com> | 2014-05-08 15:27:53 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-05-08 15:27:53 (GMT) |
commit | 7b3def93b630ee7964b1d33b2b601e07c7797438 (patch) | |
tree | 574eca7299af0b5a5898d6aff6b83dc5aef66311 /Modules | |
parent | 6eafe843ca632eadd896cca95c42420b48e2a9a2 (diff) | |
parent | 205215fb8a8aa950026d914377a54ae358a1c02a (diff) | |
download | CMake-7b3def93b630ee7964b1d33b2b601e07c7797438.zip CMake-7b3def93b630ee7964b1d33b2b601e07c7797438.tar.gz CMake-7b3def93b630ee7964b1d33b2b601e07c7797438.tar.bz2 |
Merge topic 'decay-language-version'
205215fb cmTarget: Add CXX_STANDARD_REQUIRED to control decay.
1df2116b Features: Decay language flag if requested is not available.
c4f4dac2 Project: Fix exit-on-error with compile feature tests.
5bb7ce72 Project: Use nullary form of main for compile feature tests.
64254e7a Project: Remove extern from static string in feature tests.
0d9c99bf Help: Fix order of help entries.
dc7639bd Tests: Fix name of cache variable.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/Compiler/GNU-CXX.cmake | 9 | ||||
-rw-r--r-- | Modules/Internal/FeatureTesting.cmake | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index 6ec3958..d324985 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -24,17 +24,18 @@ elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.3) set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x") endif() +set(CMAKE_CXX_STANDARD_DEFAULT 98) + 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) + if (_result EQUAL 0) + _get_gcc_features(c++98 CMAKE_CXX98_COMPILE_FEATURES) + endif() else() set(_result 0) endif() diff --git a/Modules/Internal/FeatureTesting.cmake b/Modules/Internal/FeatureTesting.cmake index 0fff36b..7bf6d91 100644 --- a/Modules/Internal/FeatureTesting.cmake +++ b/Modules/Internal/FeatureTesting.cmake @@ -5,7 +5,7 @@ macro(record_compiler_features lang compile_flags feature_list) string(TOLOWER ${lang} lang_lc) file(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.bin") file(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.${lang_lc}" " - extern const char features[] = {\"\"\n") + const char features[] = {\"\"\n") get_property(known_features GLOBAL PROPERTY CMAKE_${lang}_KNOWN_FEATURES) @@ -20,7 +20,7 @@ macro(record_compiler_features lang compile_flags feature_list) endif() endforeach() file(APPEND "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.${lang_lc}" - "\n};\n\nint main(int, char **) { return 0; }\n") + "\n};\n\nint main() { return 0; }\n") try_compile(CMAKE_${lang}_FEATURE_TEST ${CMAKE_BINARY_DIR} "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.${lang_lc}" |