summaryrefslogtreecommitdiffstats
path: root/Source/Checks
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-03-07 19:55:54 (GMT)
committerBrad King <brad.king@kitware.com>2019-03-07 19:55:54 (GMT)
commit4ca5a815f2dfe9e1116cc2ccd5ddb56d0d00d12e (patch)
tree8d2ec7eca4e38386ee772e42489c865bb02cb2d1 /Source/Checks
parent20a41aa589d4418f9ac46fc8c0402162d1d82873 (diff)
downloadCMake-4ca5a815f2dfe9e1116cc2ccd5ddb56d0d00d12e.zip
CMake-4ca5a815f2dfe9e1116cc2ccd5ddb56d0d00d12e.tar.gz
CMake-4ca5a815f2dfe9e1116cc2ccd5ddb56d0d00d12e.tar.bz2
C++ feature checks: Match warnings more strictly
Require the word "warning" to appear at the start of a line, after whitespace, or after a `:`. This is the same that CTest launchers use to match warnings. It avoids matching "warning" inside file paths. Fixes: #19019
Diffstat (limited to 'Source/Checks')
-rw-r--r--Source/Checks/cm_cxx_features.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index d941c16..fb68ed7 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -27,7 +27,7 @@ function(cm_check_cxx_feature name)
# Filter out xcodebuild warnings.
string(REGEX REPLACE "[^\n]* xcodebuild\\[[0-9]*:[0-9]*\\] warning: [^\n]*" "" check_output "${check_output}")
# If using the feature causes warnings, treat it as broken/unavailable.
- if(check_output MATCHES "[Ww]arning")
+ if(check_output MATCHES "(^|[ :])[Ww][Aa][Rr][Nn][Ii][Nn][Gg]")
set(CMake_HAVE_CXX_${FEATURE} OFF CACHE INTERNAL "TRY_COMPILE" FORCE)
endif()
if(CMake_HAVE_CXX_${FEATURE})