From eb3abf8b2ba514cec7d882bcde9d136fa3e023b7 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 19 Sep 2017 09:22:54 -0400 Subject: C++ feature checks: Prepare for multiple check output filters --- Source/Checks/cm_cxx_features.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake index ab80f5b..2dfd695 100644 --- a/Source/Checks/cm_cxx_features.cmake +++ b/Source/Checks/cm_cxx_features.cmake @@ -14,8 +14,9 @@ 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}") # 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) -- cgit v0.12 From 71b65abca26a7f2ad441235c2eacb8164c512b11 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 19 Sep 2017 09:24:20 -0400 Subject: C++ feature checks: Filter out warnings caused by user flags Filter out `-Winvalid-command-line-argument` warnings from Clang (that can be caused by user-specified flags) so that they do not break our checks for C++ feature availability. --- Source/Checks/cm_cxx_features.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake index 2dfd695..2c39cbe 100644 --- a/Source/Checks/cm_cxx_features.cmake +++ b/Source/Checks/cm_cxx_features.cmake @@ -17,6 +17,8 @@ function(cm_check_cxx_feature name) set(check_output "${OUTPUT}") # Filter out MSBuild output that looks like a warning. 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) -- cgit v0.12