summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2020-10-04 06:09:21 (GMT)
committerRaul Tambre <raul@tambre.ee>2020-10-04 06:09:21 (GMT)
commit079ea66468a6ffe0b02c3d6622bc0230fdf455b0 (patch)
tree8780b1dd70cfcd63d8b560474eb915740ed9ea91
parent3ae3b352d1b67ec2ca8bce0a74a74381d05b9f04 (diff)
downloadCMake-079ea66468a6ffe0b02c3d6622bc0230fdf455b0.zip
CMake-079ea66468a6ffe0b02c3d6622bc0230fdf455b0.tar.gz
CMake-079ea66468a6ffe0b02c3d6622bc0230fdf455b0.tar.bz2
CMakeDetermineCompilerABI: Handle NVCC-style -Werror flags
NVCC doesn't require an equals sign for its -Werror flags. Fixes #21265.
-rw-r--r--Help/release/dev/cuda-nvcc-werror-abi.rst4
-rw-r--r--Modules/CMakeDetermineCompilerABI.cmake2
2 files changed, 5 insertions, 1 deletions
diff --git a/Help/release/dev/cuda-nvcc-werror-abi.rst b/Help/release/dev/cuda-nvcc-werror-abi.rst
new file mode 100644
index 0000000..73e6ee6
--- /dev/null
+++ b/Help/release/dev/cuda-nvcc-werror-abi.rst
@@ -0,0 +1,4 @@
+cuda-nvcc-werror-abi
+--------------------
+
+* Compiler ABI detection now handles NVCC-style ``-Werror`` flags.
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index 50d5cd1..7e5b375 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -33,7 +33,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