cm_cxx_features: Ignore MSVC command-line warnings (Dxxxx)

The Dxxxx warning range is for command-line warnings [1].  These are
incidental and should not affect the result of the feature check.

[1] https://learn.microsoft.com/en-us/cpp/error-messages/tool-errors/command-line-errors-d8000-through-d9999
This commit is contained in:
Roffild
2023-03-02 09:45:41 -05:00
committed by Brad King
parent b32949d47e
commit 442170a5e7

View File

@@ -38,6 +38,8 @@ function(cm_check_cxx_feature name)
string(REGEX REPLACE " +0 Warning\\(s\\)" "" check_output "${check_output}")
# Filter out MSBuild output that looks like a warning.
string(REGEX REPLACE "[^\n]*warning MSB[0-9][0-9][0-9][0-9][^\n]*" "" check_output "${check_output}")
# Filter out MSVC output that looks like a command-line warning.
string(REGEX REPLACE "[^\n]*warning D[0-9][0-9][0-9][0-9][^\n]*" "" 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}")
# Filter out warnings caused by local configuration.