diff options
author | Brad King <brad.king@kitware.com> | 2019-03-21 14:02:59 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-03-21 14:03:10 (GMT) |
commit | e09c606eb47c13bd435892625943e95bb9452996 (patch) | |
tree | f38fa9f947c82cdc0eaba9172cb10d5a61a67a7b /Modules | |
parent | 1e9cb46c8a9c78261d22ad40af5aff1635b919cf (diff) | |
parent | 85415afbdc65baa5dbe86a61008a3a3373e74e09 (diff) | |
download | CMake-e09c606eb47c13bd435892625943e95bb9452996.zip CMake-e09c606eb47c13bd435892625943e95bb9452996.tar.gz CMake-e09c606eb47c13bd435892625943e95bb9452996.tar.bz2 |
Merge topic 'dont_do_compiler_feature_checks_for_version_with_no_features'
85415afbdc CompileFeatures: Don't try_compile for language levels with no features
616282a5ce CMake: Provide language level compile features lists
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3128
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/Internal/FeatureTesting.cmake | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Modules/Internal/FeatureTesting.cmake b/Modules/Internal/FeatureTesting.cmake index de336e7..b9c20ec 100644 --- a/Modules/Internal/FeatureTesting.cmake +++ b/Modules/Internal/FeatureTesting.cmake @@ -71,10 +71,20 @@ endmacro() macro(_record_compiler_features_c std) list(APPEND CMAKE_C${std}_COMPILE_FEATURES c_std_${std}) - _record_compiler_features(C "${CMAKE_C${std}_STANDARD_COMPILE_OPTION}" CMAKE_C${std}_COMPILE_FEATURES) + + get_property(lang_level_has_features GLOBAL PROPERTY CMAKE_C${std}_KNOWN_FEATURES) + if(lang_level_has_features) + _record_compiler_features(C "${CMAKE_C${std}_STANDARD_COMPILE_OPTION}" CMAKE_C${std}_COMPILE_FEATURES) + endif() + unset(lang_level_has_features) endmacro() macro(_record_compiler_features_cxx std) list(APPEND CMAKE_CXX${std}_COMPILE_FEATURES cxx_std_${std}) - _record_compiler_features(CXX "${CMAKE_CXX${std}_STANDARD_COMPILE_OPTION}" CMAKE_CXX${std}_COMPILE_FEATURES) + + get_property(lang_level_has_features GLOBAL PROPERTY CMAKE_CXX${std}_KNOWN_FEATURES) + if(lang_level_has_features) + _record_compiler_features(CXX "${CMAKE_CXX${std}_STANDARD_COMPILE_OPTION}" CMAKE_CXX${std}_COMPILE_FEATURES) + endif() + unset(lang_level_has_features) endmacro() |