summaryrefslogtreecommitdiff
path: root/Source/Checks
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-09-19 09:24:20 -0400
committerBrad King <brad.king@kitware.com>2017-09-19 09:25:30 -0400
commit71b65abca26a7f2ad441235c2eacb8164c512b11 (patch)
treebaaf7c394fffae9ead9f2c66401a41376cb98820 /Source/Checks
parenteb3abf8b2ba514cec7d882bcde9d136fa3e023b7 (diff)
downloadcmake-71b65abca26a7f2ad441235c2eacb8164c512b11.tar.gz
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 2dfd695c84..2c39cbeb69 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)