C++ feature checks: Do not match "0 Warning(s)" as a warning

The change in commit v3.9.0-rc1~6^2~1 (C++ feature checks: check output
for '[Ww]arning', 2017-06-03) accidentally matches `0 Warning(s)` in the
output and always thinks a warning exists, thus failing all checks in
Visual Studio builds.

Fixes: #16942
This commit is contained in:
Walter Gray 2017-06-05 22:43:36 -07:00 committed by Brad King
parent d025faf436
commit f4ce396254

View File

@ -15,7 +15,7 @@ function(cm_check_cxx_feature name)
OUTPUT_VARIABLE OUTPUT
)
# If using the feature causes warnings, treat it as broken/unavailable.
if(OUTPUT MATCHES "[Ww]arning")
if(OUTPUT MATCHES "[Ww]arning" AND NOT OUTPUT MATCHES "0 Warning")
set(CMake_HAVE_CXX_${FEATURE} OFF CACHE INTERNAL "TRY_COMPILE" FORCE)
endif()
if(CMake_HAVE_CXX_${FEATURE})