summaryrefslogtreecommitdiff
path: root/Modules/Internal/FeatureTesting.cmake
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2019-03-27 15:44:37 -0400
committerBrad King <brad.king@kitware.com>2019-04-09 08:44:56 -0400
commit646fb1a646a3b860e983f3d030dfd223c761d49f (patch)
tree50598f673d9f8e7f18e9a001cecbf6be0d74b964 /Modules/Internal/FeatureTesting.cmake
parent0d641fcfad232a6981f587a8ee077dcf08432843 (diff)
downloadcmake-646fb1a646a3b860e983f3d030dfd223c761d49f.tar.gz
CompileFeatures: memoize C++ compilers with full language level support
Previously compilers that had full support for a language standard level were still verified every time a new build directory was created. Now we record this information and insert the correct granular compile features instead of doing a `try_compile`.
Diffstat (limited to 'Modules/Internal/FeatureTesting.cmake')
-rw-r--r--Modules/Internal/FeatureTesting.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/Internal/FeatureTesting.cmake b/Modules/Internal/FeatureTesting.cmake
index f7b3e96c7b..75be473f39 100644
--- a/Modules/Internal/FeatureTesting.cmake
+++ b/Modules/Internal/FeatureTesting.cmake
@@ -99,3 +99,7 @@ macro(_has_compiler_features_c std)
list(APPEND CMAKE_C${std}_COMPILE_FEATURES c_std_${std})
_has_compiler_features(C ${std} "${CMAKE_C${std}_STANDARD_COMPILE_OPTION}" CMAKE_C${std}_COMPILE_FEATURES)
endmacro()
+macro(_has_compiler_features_cxx std)
+ list(APPEND CMAKE_CXX${std}_COMPILE_FEATURES cxx_std_${std})
+ _has_compiler_features(CXX ${std} "${CMAKE_CXX${std}_STANDARD_COMPILE_OPTION}" CMAKE_CXX${std}_COMPILE_FEATURES)
+endmacro()