mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 10:50:16 -06:00
CMakeDetermineCompilerABI: Avoid failing on warnings with -Werror
Simply remove `-Werror` flags from `CMAKE_<LANG>_FLAGS` to avoid failing ABI detection if there happen to be warnings in the test project. For example, `-Wunused-command-line-argument` warnings are common since the ABI detection project may not exercise all the flags passed by users. Fixes: #20305
This commit is contained in:
@@ -32,6 +32,9 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
|
||||
endif()
|
||||
__TestCompiler_setTryCompileTargetType()
|
||||
|
||||
# Avoid failing ABI detection on warnings.
|
||||
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
|
||||
# English and we can grok it.
|
||||
|
||||
Reference in New Issue
Block a user