summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-04-27 13:12:01 -0400
committerBrad King <brad.king@kitware.com>2018-04-30 09:18:15 -0400
commit2254b72061e08006e94c9a8ea3b9169f3f2cc1e6 (patch)
treebcaae4b580b2972da997286a1dad4863a289bffd
parentfbe6cd1596bf280edd49aeb8f981f99d7cd8beb3 (diff)
downloadcmake-2254b72061e08006e94c9a8ea3b9169f3f2cc1e6.tar.gz
C++ feature checks: Filter out warnings caused by local configuration
In some environments the linker produces warnings like warning: directory not found for option warning: object file compiled with -mlong-branch ... These do not affect the availability of C++ features we're checking, so filter them out. Fixes: #17850, #17947
-rw-r--r--Source/Checks/cm_cxx_features.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index 2704c4032a..2a1abbab61 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -19,6 +19,9 @@ function(cm_check_cxx_feature name)
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}")
+ # Filter out warnings caused by local configuration.
+ string(REGEX REPLACE "[^\n]*warning:[^\n]*directory not found for option[^\n]*" "" check_output "${check_output}")
+ string(REGEX REPLACE "[^\n]*warning:[^\n]*object file compiled with -mlong-branch which is no longer needed[^\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)