mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-02 03:39:43 -06:00
CMakeDetermineCompilerABI: Avoid removing the flag after -Werror
The matching became too eager after commit079ea66468(CMakeDetermineCompilerABI: Handle NVCC-style -Werror flags, 2020-10-04, v3.19.0-rc1~45^2). When -Werror was specified without a value we would eat the following flag. Prevent this by disallowing "-" as the first character of the flag's value. Fixes:079ea66468See-also: https://discourse.cmake.org/t/8230
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user