summaryrefslogtreecommitdiffstats
path: root/Modules/WriteCompilerDetectionHeader.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-10-26 20:26:22 (GMT)
committerBrad King <brad.king@kitware.com>2016-11-02 14:01:23 (GMT)
commita34b98a834bf6ac044e8590c3fe644c9307124e9 (patch)
tree9b7892031971bf91fb0445d5ed4ff7947ba9fa60 /Modules/WriteCompilerDetectionHeader.cmake
parentb0996a3fa223370edcdb40a1d8b66d1a3a734daf (diff)
downloadCMake-a34b98a834bf6ac044e8590c3fe644c9307124e9.zip
CMake-a34b98a834bf6ac044e8590c3fe644c9307124e9.tar.gz
CMake-a34b98a834bf6ac044e8590c3fe644c9307124e9.tar.bz2
WCDH: Ignore language standard meta-features
The `{c,cxx}_std_*` features are meant for use with `target_compile_features` but do not make sense for use with WriteCompilerDetectionHeader. Filter them out of any requested list.
Diffstat (limited to 'Modules/WriteCompilerDetectionHeader.cmake')
-rw-r--r--Modules/WriteCompilerDetectionHeader.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake
index 82e8fba..a390f4b 100644
--- a/Modules/WriteCompilerDetectionHeader.cmake
+++ b/Modules/WriteCompilerDetectionHeader.cmake
@@ -76,6 +76,7 @@
# Available features in this version of CMake are listed in the
# :prop_gbl:`CMAKE_C_KNOWN_FEATURES` and
# :prop_gbl:`CMAKE_CXX_KNOWN_FEATURES` global properties.
+# The ``{c,cxx}_std_*`` meta-features are ignored if requested.
#
# See the :manual:`cmake-compile-features(7)` manual for information on
# compile features.
@@ -358,7 +359,11 @@ function(write_compiler_detection_header
endif()
foreach(feature ${_WCD_FEATURES})
- if (feature MATCHES "^cxx_")
+ if (feature MATCHES "^c_std_")
+ # ignored
+ elseif (feature MATCHES "^cxx_std_")
+ # ignored
+ elseif (feature MATCHES "^cxx_")
list(APPEND _langs CXX)
list(APPEND CXX_features ${feature})
elseif (feature MATCHES "^c_")