summaryrefslogtreecommitdiffstats
path: root/Source/Checks
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-09-19 13:24:20 (GMT)
committerBrad King <brad.king@kitware.com>2017-09-19 13:25:30 (GMT)
commit71b65abca26a7f2ad441235c2eacb8164c512b11 (patch)
treebaaf7c394fffae9ead9f2c66401a41376cb98820 /Source/Checks
parenteb3abf8b2ba514cec7d882bcde9d136fa3e023b7 (diff)
downloadCMake-71b65abca26a7f2ad441235c2eacb8164c512b11.zip
CMake-71b65abca26a7f2ad441235c2eacb8164c512b11.tar.gz
CMake-71b65abca26a7f2ad441235c2eacb8164c512b11.tar.bz2
C++ feature checks: Filter out warnings caused by user flags
Filter out `-Winvalid-command-line-argument` warnings from Clang (that can be caused by user-specified flags) so that they do not break our checks for C++ feature availability.
Diffstat (limited to 'Source/Checks')
-rw-r--r--Source/Checks/cm_cxx_features.cmake2
1 files changed, 2 insertions, 0 deletions
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index 2dfd695..2c39cbe 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -17,6 +17,8 @@ function(cm_check_cxx_feature name)
set(check_output "${OUTPUT}")
# Filter out MSBuild output that looks like a warning.
string(REGEX REPLACE " +0 Warning\\(s\\)" "" check_output "${check_output}")
+ # Filter out warnings caused by user flags.
+ string(REGEX REPLACE "[^\n]*warning:[^\n]*-Winvalid-command-line-argument[^\n]*" "" check_output "${check_output}")
# If using the feature causes warnings, treat it as broken/unavailable.
if(check_output MATCHES "[Ww]arning")
set(CMake_HAVE_CXX_${FEATURE} OFF CACHE INTERNAL "TRY_COMPILE" FORCE)