diff options
author | Moritz Warning <moritzwarning@web.de> | 2019-03-06 22:26:50 +0100 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2019-03-10 17:48:23 +0100 |
commit | 7fc4dd3611d1569db99444425feaddc545699c06 (patch) | |
tree | 7a36bc66aa7e1d93f865667fd84a152301475c1e /tools/cmake | |
parent | ff3cfe084885662843a6cc95a547eb9f8ef48fa5 (diff) | |
download | upstream-7fc4dd3611d1569db99444425feaddc545699c06.tar.gz upstream-7fc4dd3611d1569db99444425feaddc545699c06.tar.bz2 upstream-7fc4dd3611d1569db99444425feaddc545699c06.zip |
cmake: match warnings more strictly in C++ feature checks
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.
Fixed in cmake 3.14.0.
Signed-off-by: Moritz Warning <moritzwarning@web.de>
Diffstat (limited to 'tools/cmake')
-rw-r--r-- | tools/cmake/patches/150-C-feature-checks-Match-warnings-more-strictly.patch | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/cmake/patches/150-C-feature-checks-Match-warnings-more-strictly.patch b/tools/cmake/patches/150-C-feature-checks-Match-warnings-more-strictly.patch new file mode 100644 index 0000000000..674ff0d392 --- /dev/null +++ b/tools/cmake/patches/150-C-feature-checks-Match-warnings-more-strictly.patch @@ -0,0 +1,25 @@ +From 4ca5a815f2dfe9e1116cc2ccd5ddb56d0d00d12e Mon Sep 17 00:00:00 2001 +From: Brad King <brad.king@kitware.com> +Date: Thu, 7 Mar 2019 14:55:54 -0500 +Subject: [PATCH] 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 +--- + Source/Checks/cm_cxx_features.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/Source/Checks/cm_cxx_features.cmake ++++ b/Source/Checks/cm_cxx_features.cmake +@@ -25,7 +25,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}) |