summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2020-08-24 13:49:48 (GMT)
committerRobert Maynard <robert.maynard@kitware.com>2020-08-24 13:53:38 (GMT)
commitbed315a0da0030a9124ccc8f0518a56cac7205b9 (patch)
tree639a71c422e74c304e867b70b07a401381f35560 /Modules
parentaaa5eab410c2e3fe41ebf7a2316be9c51572dbd2 (diff)
downloadCMake-bed315a0da0030a9124ccc8f0518a56cac7205b9.zip
CMake-bed315a0da0030a9124ccc8f0518a56cac7205b9.tar.gz
CMake-bed315a0da0030a9124ccc8f0518a56cac7205b9.tar.bz2
CUDA: Support setting CUDA14/17 when using MSVC
Fixes #20953
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Compiler/NVIDIA-CUDA.cmake10
1 files 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()