From 95700be52d860aa4f4e5b4c7562c9bb97acb4b2a Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Wed, 10 Jun 2020 13:27:51 -0400 Subject: CUDA: Teach CMake that NVCC 11 supports cuda_std_17 --- Modules/Compiler/NVIDIA-CUDA.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake index 87607e2..feb5ecc 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. -- cgit v0.12