summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCompilerId.cmake
diff options
context:
space:
mode:
authorRobert Maynard <rmaynard@nvidia.com>2022-03-09 14:14:18 (GMT)
committerBrad King <brad.king@kitware.com>2022-03-09 17:30:12 (GMT)
commit2a79b647fac5fc702082385cb30fedf82a972b5e (patch)
treefc7ae6a9a1b7034159e766c6b24aa121ba77b198 /Modules/CMakeDetermineCompilerId.cmake
parent1aa51fb9e3ba3e9ddeafe4929c8f6f58a5fd34b7 (diff)
downloadCMake-2a79b647fac5fc702082385cb30fedf82a972b5e.zip
CMake-2a79b647fac5fc702082385cb30fedf82a972b5e.tar.gz
CMake-2a79b647fac5fc702082385cb30fedf82a972b5e.tar.bz2
CUDA: Restore support for CMAKE_CUDA_ARCHITECTURES=OFF
Fixes: #23309
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index e0aa483..5670509 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -495,7 +495,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
if(CMAKE_VS_PLATFORM_NAME STREQUAL x64)
set(cuda_target "<TargetMachinePlatform>64</TargetMachinePlatform>")
endif()
- if(NOT CMAKE_CUDA_ARCHITECTURES MATCHES "^(all|all-major)$")
+ if(CMAKE_CUDA_ARCHITECTURES AND NOT CMAKE_CUDA_ARCHITECTURES MATCHES "^(all|all-major)$")
foreach(arch ${CMAKE_CUDA_ARCHITECTURES})
string(REGEX MATCH "[0-9]+" arch_name "${arch}")
string(APPEND cuda_codegen "compute_${arch_name},sm_${arch_name};")