Merge topic 'werror_space_fix'

cec6f98018 CMakeDetermineCompilerABI: Avoid removing the flag after -Werror

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !8518
This commit is contained in:
Brad King
2023-05-31 13:24:56 +00:00
committed by Kitware Robot

View File

@@ -42,7 +42,7 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
__TestCompiler_setTryCompileTargetType()
# Avoid failing ABI detection on warnings.
string(REGEX REPLACE "(^| )-Werror([= ][^ ]*)?( |$)" " " CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}")
string(REGEX REPLACE "(^| )-Werror([= ][^-][^ ]*)?( |$)" " " CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}")
# Save the current LC_ALL, LC_MESSAGES, and LANG environment variables
# and set them to "C" that way GCC's "search starts here" text is in