cm_cxx_features: Ignore distcc warnings

Filter out warnings of distcc which does not provide information
about compiler feature availability.

Fixes: #22573
This commit is contained in:
Martin Mokry
2024-06-02 12:22:37 +02:00
parent e873e8f81a
commit c9e30d75d2

View File

@@ -57,6 +57,8 @@ function(cm_check_cxx_feature name)
string(REGEX REPLACE "[^\n]*icpc: command line warning #10121: overriding [^\n]*" "" check_output "${check_output}")
# Filter out ld warnings.
string(REGEX REPLACE "[^\n]*ld: warning: [^\n]*" "" check_output "${check_output}")
# Filter out distcc.
string(REGEX REPLACE "[^\n]*distcc\\[[0-9]+\\][^\n]*[Ww]arning:[^\n]*" "" check_output "${check_output}")
# If using the feature causes warnings, treat it as broken/unavailable.
if(check_output MATCHES "(^|[ :])[Ww][Aa][Rr][Nn][Ii][Nn][Gg]")
set(CMake_HAVE_CXX_${FEATURE} OFF CACHE INTERNAL "TRY_COMPILE" FORCE)