diff options
author | Robert Maynard <rmaynard@nvidia.com> | 2022-06-27 18:42:46 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-07-01 12:04:54 (GMT) |
commit | cd324110d2ecef8dd955f7089382d15708cad98d (patch) | |
tree | 60dc7e97e0752690ac8bee19bb92842356e2f138 /Modules/Compiler | |
parent | 2e9ac1d2726c4f260efd6b455242ec5d65391e12 (diff) | |
download | CMake-cd324110d2ecef8dd955f7089382d15708cad98d.zip CMake-cd324110d2ecef8dd955f7089382d15708cad98d.tar.gz CMake-cd324110d2ecef8dd955f7089382d15708cad98d.tar.bz2 |
CUDA: NVCC support for COMPILE_WARNING_AS_ERROR target property
Diffstat (limited to 'Modules/Compiler')
-rw-r--r-- | Modules/Compiler/NVIDIA-CUDA.cmake | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake index 2f12b43..2e3ae2c 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 |