From bed315a0da0030a9124ccc8f0518a56cac7205b9 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Mon, 24 Aug 2020 09:49:48 -0400 Subject: CUDA: Support setting CUDA14/17 when using MSVC Fixes #20953 --- Modules/Compiler/NVIDIA-CUDA.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake index feb5ecc..3187294 100644 --- a/Modules/Compiler/NVIDIA-CUDA.cmake +++ b/Modules/Compiler/NVIDIA-CUDA.cmake @@ -68,20 +68,22 @@ if(UNIX) endif() if("x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC") + # MSVC requires c++14 as the minimum level set(CMAKE_CUDA03_STANDARD_COMPILE_OPTION "") set(CMAKE_CUDA03_EXTENSION_COMPILE_OPTION "") + # MSVC requires c++14 as the minimum level set(CMAKE_CUDA11_STANDARD_COMPILE_OPTION "") set(CMAKE_CUDA11_EXTENSION_COMPILE_OPTION "") if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 9.0) - set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "") - set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "") + set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "-std=c++14") + 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 "") - set(CMAKE_CUDA17_EXTENSION_COMPILE_OPTION "") + set(CMAKE_CUDA17_STANDARD_COMPILE_OPTION "-std=c++17") + set(CMAKE_CUDA17_EXTENSION_COMPILE_OPTION "-std=c++17") endif() else() -- cgit v0.12