diff options
author | Brad King <brad.king@kitware.com> | 2020-10-27 11:05:11 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-10-27 11:05:18 (GMT) |
commit | 6739e8560c30ed4738c016fdac7d361efb0d7a12 (patch) | |
tree | 324edc9f99bbb214437f3132a022987f4e429ac6 /Modules | |
parent | 37bbe11b0673e6728a0893b8ddbda69d1536671a (diff) | |
parent | 2b0d3c3524fd96c17520cac766205bed333666b1 (diff) | |
download | CMake-6739e8560c30ed4738c016fdac7d361efb0d7a12.zip CMake-6739e8560c30ed4738c016fdac7d361efb0d7a12.tar.gz CMake-6739e8560c30ed4738c016fdac7d361efb0d7a12.tar.bz2 |
Merge topic 'correct_msvc_cuda_flag_warning'
2b0d3c3524 CUDA: Use MSVC version to determine supported C++ standard levels
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5423
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() |