Merge topic 'cuda_nvcc_abi_werror'

079ea66468 CMakeDetermineCompilerABI: Handle NVCC-style -Werror flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Seth R Johnson <johnsonsr@ornl.gov>
Merge-request: !5318
This commit is contained in:
Brad King
2020-10-05 12:54:45 +00:00
committed by Kitware Robot
2 changed files with 5 additions and 1 deletions

View File

@@ -0,0 +1,4 @@
cuda-nvcc-werror-abi
--------------------
* Compiler ABI detection now handles NVCC-style ``-Werror`` flags.

View File

@@ -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