summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-07-05 14:31:11 +0000
committerKitware Robot <kwrobot@kitware.com>2022-07-05 10:31:22 -0400
commit6fee995256fc4b8aae5484eb450499818d65470c (patch)
tree60aef114cab9600a406c18a493400893fc2592f3 /Modules
parentba107f05b346de59d72f10aead5f51e577021275 (diff)
parentcd324110d2ecef8dd955f7089382d15708cad98d (diff)
downloadcmake-6fee995256fc4b8aae5484eb450499818d65470c.tar.gz
Merge topic 'add_nvcc_compile_warning_support' into release-3.24
cd324110d2 CUDA: NVCC support for COMPILE_WARNING_AS_ERROR target property 2e9ac1d272 Tests: Refactor warn on error tests to support multiple languages Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7417
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Compiler/NVIDIA-CUDA.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake
index 2f12b4378b..2e3ae2c3db 100644
--- a/Modules/Compiler/NVIDIA-CUDA.cmake
+++ b/Modules/Compiler/NVIDIA-CUDA.cmake
@@ -30,6 +30,11 @@ if(CMAKE_CUDA_HOST_COMPILER AND NOT CMAKE_GENERATOR MATCHES "Visual Studio")
endif()
if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 10.2.89)
+ # Starting in 10.2, nvcc supported treating all warnings as errors
+ set(CMAKE_CUDA_COMPILE_OPTIONS_WARNING_AS_ERROR "-Werror all-warnings")
+endif()
+
+if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 10.2.89)
# The -MD flag was only added to nvcc in 10.2 so
# before that we had to invoke the compiler twice
# to get header dependency information