summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2023-05-29 14:18:55 (GMT)
committerBrad King <brad.king@kitware.com>2023-05-30 15:03:09 (GMT)
commitcec6f980181d9ca88ff53f0b1626713ed98a3369 (patch)
tree82c53afc69426441453aa40bc4f8b68223523ccc /Modules
parentb50caaf96a33dd57ff6699cbb296131be0296ce9 (diff)
downloadCMake-cec6f980181d9ca88ff53f0b1626713ed98a3369.zip
CMake-cec6f980181d9ca88ff53f0b1626713ed98a3369.tar.gz
CMake-cec6f980181d9ca88ff53f0b1626713ed98a3369.tar.bz2
CMakeDetermineCompilerABI: Avoid removing the flag after -Werror
The matching became too eager after commit 079ea66468 (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: 079ea66468a6ffe0b02c3d6622bc0230fdf455b0 See-also: https://discourse.cmake.org/t/8230
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeDetermineCompilerABI.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index 3fd54cc..df17796 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -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