Browse Source

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
Walter Gray 8 năm trước cách đây
mục cha
commit
f4ce396254
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      Source/Checks/cm_cxx_features.cmake

+ 1 - 1
Source/Checks/cm_cxx_features.cmake

@@ -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})