summaryrefslogtreecommitdiffstats
path: root/Modules/Internal/FeatureTesting.cmake
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-05-02 08:03:24 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-05-02 08:18:16 (GMT)
commit3fdfa5d3fc1170f1cc69636765502ca14b1821ef (patch)
treeac2a317995ebc4a3d67bbc814b566bde84e0ec71 /Modules/Internal/FeatureTesting.cmake
parenta354a8ba5e6ad23e2317f684434136bea622154b (diff)
downloadCMake-3fdfa5d3fc1170f1cc69636765502ca14b1821ef.zip
CMake-3fdfa5d3fc1170f1cc69636765502ca14b1821ef.tar.gz
CMake-3fdfa5d3fc1170f1cc69636765502ca14b1821ef.tar.bz2
Features: Make CMAKE_CXX_KNOWN_FEATURES a property.
As a 'built-in' variable it imposes a cost on all variable lookups and it is expected to be rarely used.
Diffstat (limited to 'Modules/Internal/FeatureTesting.cmake')
-rw-r--r--Modules/Internal/FeatureTesting.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/Internal/FeatureTesting.cmake b/Modules/Internal/FeatureTesting.cmake
index 92d262c..0fff36b 100644
--- a/Modules/Internal/FeatureTesting.cmake
+++ b/Modules/Internal/FeatureTesting.cmake
@@ -6,7 +6,10 @@ macro(record_compiler_features lang compile_flags feature_list)
file(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.bin")
file(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.${lang_lc}" "
extern const char features[] = {\"\"\n")
- foreach(feature ${CMAKE_${lang}_KNOWN_FEATURES})
+
+ get_property(known_features GLOBAL PROPERTY CMAKE_${lang}_KNOWN_FEATURES)
+
+ foreach(feature ${known_features})
if (_cmake_feature_test_${feature})
if (${_cmake_feature_test_${feature}} STREQUAL 1)
set(_feature_condition "\"1\" ")