diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2020-10-25 18:08:55 (GMT) |
---|---|---|
committer | Robert Maynard <robert.maynard@kitware.com> | 2020-10-26 15:36:55 (GMT) |
commit | 2b0d3c3524fd96c17520cac766205bed333666b1 (patch) | |
tree | 4c805ec4e0999acc295ddf5335526c71d49958a9 /Modules | |
parent | 0b0df2d0638c1505463039bab0669eeb550b0471 (diff) | |
download | CMake-2b0d3c3524fd96c17520cac766205bed333666b1.zip CMake-2b0d3c3524fd96c17520cac766205bed333666b1.tar.gz CMake-2b0d3c3524fd96c17520cac766205bed333666b1.tar.bz2 |
CUDA: Use MSVC version to determine supported C++ standard levels
Fixes: #21335
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/Compiler/NVIDIA-CUDA.cmake | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake index 7c24373..1a724a0 100644 --- a/Modules/Compiler/NVIDIA-CUDA.cmake +++ b/Modules/Compiler/NVIDIA-CUDA.cmake @@ -78,13 +78,20 @@ if("x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC") set(CMAKE_CUDA11_EXTENSION_COMPILE_OPTION "") if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 9.0) - set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "-std=c++14") - set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "-std=c++14") + if(CMAKE_CUDA_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.10.25017) + set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "-std=c++14") + set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "-std=c++14") + else() + set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "") + set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "") + endif() 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") + if(CMAKE_CUDA_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.11.25505) + set(CMAKE_CUDA17_STANDARD_COMPILE_OPTION "-std=c++17") + set(CMAKE_CUDA17_EXTENSION_COMPILE_OPTION "-std=c++17") + endif() endif() else() |