summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/NVIDIA-CUDA.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-07-05 14:31:11 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-07-05 14:31:23 (GMT)
commitd5772027c2928c8a3b10bf50f6fe51c9f85694a0 (patch)
tree29f82b507332f6d0aed40c22a31aff0025b8a869 /Modules/Compiler/NVIDIA-CUDA.cmake
parent15f4ee89fe2f140266801dfbfabb5ba0fcff8bf7 (diff)
parentcd324110d2ecef8dd955f7089382d15708cad98d (diff)
downloadCMake-d5772027c2928c8a3b10bf50f6fe51c9f85694a0.zip
CMake-d5772027c2928c8a3b10bf50f6fe51c9f85694a0.tar.gz
CMake-d5772027c2928c8a3b10bf50f6fe51c9f85694a0.tar.bz2
Merge topic 'add_nvcc_compile_warning_support'
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/Compiler/NVIDIA-CUDA.cmake')
-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 892df90..33509ac 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