summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-06-09 14:00:41 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-06-09 14:00:57 (GMT)
commit55d752b10855f22642dc69fd99a79af6d085831b (patch)
tree8a10878e06204f8e9d36bcde4ed83e9b08bbf4d2 /Source
parent51e1e23cf477e3918e7b98b7ae14a7041d0734f8 (diff)
parentf44d9bcc8f09c3a135fa0feb82e9d71c475eb196 (diff)
downloadCMake-55d752b10855f22642dc69fd99a79af6d085831b.zip
CMake-55d752b10855f22642dc69fd99a79af6d085831b.tar.gz
CMake-55d752b10855f22642dc69fd99a79af6d085831b.tar.bz2
Merge topic 'improve-msvc-feature-checks'
f44d9bcc C++ feature checks: Improve exclusion of "0 Warning(s)" Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !938
Diffstat (limited to 'Source')
-rw-r--r--Source/Checks/cm_cxx_features.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index c9a19af..3b08025 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -14,8 +14,10 @@ function(cm_check_cxx_feature name)
CMAKE_FLAGS ${maybe_cxx_standard}
OUTPUT_VARIABLE OUTPUT
)
+ # Filter out MSBuild output that looks like a warning.
+ string(REGEX REPLACE " +0 Warning\\(s\\)" "" check_output "${OUTPUT}")
# If using the feature causes warnings, treat it as broken/unavailable.
- if(OUTPUT MATCHES "[Ww]arning" AND NOT OUTPUT MATCHES "0 Warning")
+ if(check_output MATCHES "[Ww]arning")
set(CMake_HAVE_CXX_${FEATURE} OFF CACHE INTERNAL "TRY_COMPILE" FORCE)
endif()
if(CMake_HAVE_CXX_${FEATURE})