diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2020-06-10 13:27:51 -0400 |
---|---|---|
committer | Robert Maynard <robert.maynard@kitware.com> | 2020-06-10 13:27:51 -0400 |
commit | 95700be52d860aa4f4e5b4c7562c9bb97acb4b2a (patch) | |
tree | 7d73836d1f8776cfc9b3a6f3e184e6f9dd044342 /Modules/Compiler/NVIDIA-CUDA.cmake | |
parent | 596cfd26809793c7165b5e5047be133e0419c6e5 (diff) | |
download | cmake-95700be52d860aa4f4e5b4c7562c9bb97acb4b2a.tar.gz |
CUDA: Teach CMake that NVCC 11 supports cuda_std_17
Diffstat (limited to 'Modules/Compiler/NVIDIA-CUDA.cmake')
-rw-r--r-- | Modules/Compiler/NVIDIA-CUDA.cmake | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake index 87607e2799..feb5eccb99 100644 --- a/Modules/Compiler/NVIDIA-CUDA.cmake +++ b/Modules/Compiler/NVIDIA-CUDA.cmake @@ -78,6 +78,12 @@ if("x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC") set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "") set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "") endif() + + if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 11.0) + set(CMAKE_CUDA17_STANDARD_COMPILE_OPTION "") + set(CMAKE_CUDA17_EXTENSION_COMPILE_OPTION "") + endif() + else() set(CMAKE_CUDA03_STANDARD_COMPILE_OPTION "") set(CMAKE_CUDA03_EXTENSION_COMPILE_OPTION "") @@ -92,6 +98,11 @@ else() set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "-std=c++14") endif() + if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 11.0) + set(CMAKE_CUDA17_STANDARD_COMPILE_OPTION "-std=c++17") + set(CMAKE_CUDA17_EXTENSION_COMPILE_OPTION "-std=c++17") + endif() + endif() # FIXME: investigate use of --options-file. |