summaryrefslogtreecommitdiffstats
path: root/Modules/Internal
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-11-02 13:42:39 (GMT)
committerBrad King <brad.king@kitware.com>2016-11-02 13:51:48 (GMT)
commit8b6cc2518a8019314af43a32702a09bff318b777 (patch)
treeb662bd6f006143d11874b1ede76b430be13c5da2 /Modules/Internal
parent2d23f7b206c908e55999143487548e2d6a92bc79 (diff)
downloadCMake-8b6cc2518a8019314af43a32702a09bff318b777.zip
CMake-8b6cc2518a8019314af43a32702a09bff318b777.tar.gz
CMake-8b6cc2518a8019314af43a32702a09bff318b777.tar.bz2
Features: Centralize per-compiler recording macros
Simplify and de-duplicate per-compiler feature recording macros and convert to a centralized per-language macro.
Diffstat (limited to 'Modules/Internal')
-rw-r--r--Modules/Internal/FeatureTesting.cmake10
1 files changed, 9 insertions, 1 deletions
diff --git a/Modules/Internal/FeatureTesting.cmake b/Modules/Internal/FeatureTesting.cmake
index 86b89b2..e94246e 100644
--- a/Modules/Internal/FeatureTesting.cmake
+++ b/Modules/Internal/FeatureTesting.cmake
@@ -1,5 +1,5 @@
-macro(record_compiler_features lang compile_flags feature_list)
+macro(_record_compiler_features lang compile_flags feature_list)
include("${CMAKE_ROOT}/Modules/Compiler/${CMAKE_${lang}_COMPILER_ID}-${lang}-FeatureTests.cmake" OPTIONAL)
string(TOLOWER ${lang} lang_lc)
@@ -58,3 +58,11 @@ macro(record_compiler_features lang compile_flags feature_list)
"Detecting ${lang} [${compile_flags}] compiler features failed to compile with the following output:\n${_output}\n${_copy_error}\n\n")
endif()
endmacro()
+
+macro(_record_compiler_features_c std)
+ _record_compiler_features(C "${CMAKE_C${std}_STANDARD_COMPILE_OPTION}" CMAKE_C${std}_COMPILE_FEATURES)
+endmacro()
+
+macro(_record_compiler_features_cxx std)
+ _record_compiler_features(CXX "${CMAKE_CXX${std}_STANDARD_COMPILE_OPTION}" CMAKE_CXX${std}_COMPILE_FEATURES)
+endmacro()