summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-09-20 17:15:58 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-09-20 17:16:11 (GMT)
commitc8826fe04f5f4f8c911a751ff7979fde79e92eb1 (patch)
tree469cca706c688bba11f7a247ae1bdb2f1d76049d /Source
parent821b54f4a6e1cebfc8d5c9b061c45683a4a5c6ba (diff)
parent71b65abca26a7f2ad441235c2eacb8164c512b11 (diff)
downloadCMake-c8826fe04f5f4f8c911a751ff7979fde79e92eb1.zip
CMake-c8826fe04f5f4f8c911a751ff7979fde79e92eb1.tar.gz
CMake-c8826fe04f5f4f8c911a751ff7979fde79e92eb1.tar.bz2
Merge topic 'cxx-checks-tolerate-unused-flag'
71b65abc C++ feature checks: Filter out warnings caused by user flags eb3abf8b C++ feature checks: Prepare for multiple check output filters Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1286
Diffstat (limited to 'Source')
-rw-r--r--Source/Checks/cm_cxx_features.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index ab80f5b..2c39cbe 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -14,8 +14,11 @@ function(cm_check_cxx_feature name)
CMAKE_FLAGS ${maybe_cxx_standard}
OUTPUT_VARIABLE OUTPUT
)
+ set(check_output "${OUTPUT}")
# Filter out MSBuild output that looks like a warning.
- string(REGEX REPLACE " +0 Warning\\(s\\)" "" check_output "${OUTPUT}")
+ 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)