summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCUDACompiler.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-03-02 20:45:47 (GMT)
committerBrad King <brad.king@kitware.com>2022-03-02 20:49:14 (GMT)
commit5c1f5357b0335158aa7b31990d1df26fd04114f2 (patch)
tree9337d4861aa21f61f24bc0fc1f21fd40bc2d5774 /Modules/CMakeDetermineCUDACompiler.cmake
parent04a7200c7561509a83c34f2af45b2d091ae59248 (diff)
downloadCMake-5c1f5357b0335158aa7b31990d1df26fd04114f2.zip
CMake-5c1f5357b0335158aa7b31990d1df26fd04114f2.tar.gz
CMake-5c1f5357b0335158aa7b31990d1df26fd04114f2.tar.bz2
VS: Fix CUDA compiler id with CMAKE_CUDA_ARCHITECTURES={all,all-major}
Skip the architecture verification check for these values on Visual Studio. It cannot be implemented correctly until future work delays the check to the main compiler test step. Issue: #23164, #23161
Diffstat (limited to 'Modules/CMakeDetermineCUDACompiler.cmake')
-rw-r--r--Modules/CMakeDetermineCUDACompiler.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake
index f491c79..8c01ea4 100644
--- a/Modules/CMakeDetermineCUDACompiler.cmake
+++ b/Modules/CMakeDetermineCUDACompiler.cmake
@@ -280,7 +280,9 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN)
if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND CMAKE_CUDA_COMPILER_TOOLKIT_VERSION VERSION_GREATER_EQUAL 11.5)
string(APPEND nvcc_test_flags " -arch=${CMAKE_CUDA_ARCHITECTURES}")
set(architectures_tested "${CMAKE_CUDA_ARCHITECTURES}")
- elseif(NOT CMAKE_GENERATOR MATCHES "Visual Studio")
+ elseif(CMAKE_GENERATOR MATCHES "Visual Studio")
+ set(architectures_tested "${CMAKE_CUDA_ARCHITECTURES}")
+ else()
if(CMAKE_CUDA_ARCHITECTURES STREQUAL "all")
set(architectures_test ${CMAKE_CUDA_ARCHITECTURES_ALL})
elseif(CMAKE_CUDA_ARCHITECTURES STREQUAL "all-major")