mirror of
https://github.com/reactos/CMake.git
synced 2025-03-03 09:27:12 +00:00
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.
This commit is contained in:
parent
eb3abf8b2b
commit
71b65abca2
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user