diff options
author | Brad King <brad.king@kitware.com> | 2020-08-26 14:25:37 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-08-26 14:25:44 (GMT) |
commit | bf0262f41e36df5662f4976b7142fee81c81fabb (patch) | |
tree | bf3657cce6414e23896eccb89700bf6593c7f6ac /Modules | |
parent | ee70fe416ff7aeb4fbee851d353faf98125ec1f4 (diff) | |
parent | bed315a0da0030a9124ccc8f0518a56cac7205b9 (diff) | |
download | CMake-bf0262f41e36df5662f4976b7142fee81c81fabb.zip CMake-bf0262f41e36df5662f4976b7142fee81c81fabb.tar.gz CMake-bf0262f41e36df5662f4976b7142fee81c81fabb.tar.bz2 |
Merge topic 'cuda-std-for-msvc'
bed315a0da CUDA: Support setting CUDA14/17 when using MSVC
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5160
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/Compiler/NVIDIA-CUDA.cmake | 10 |
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() |