summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-11-01 16:51:24 (GMT)
committerBrad King <brad.king@kitware.com>2023-11-01 17:51:21 (GMT)
commit79f3f29e50d494d1e1638492bf7dda3ef9d3a5e7 (patch)
treec70b19dff87ffac179473fe2b99c954a9f8a81f1
parent27e64a8498110af4f729dd2e86ad507312d13711 (diff)
downloadCMake-79f3f29e50d494d1e1638492bf7dda3ef9d3a5e7.zip
CMake-79f3f29e50d494d1e1638492bf7dda3ef9d3a5e7.tar.gz
CMake-79f3f29e50d494d1e1638492bf7dda3ef9d3a5e7.tar.bz2
CUDA: Parse NVCC implicit compile/link information in Visual Studio generators
Refactoring in commit deff0e638d (CUDA: Factor out helper to parse NVCC implicit compiler and linker flags, 2023-09-15, v3.28.0-rc1~63^2~6) incorrectly dropped detection of the default CUDA architecture and the CUDA toolkit include directories from the code path used for Visual Studio generators. However, CMakeNVCCParseImplicitInfo is now general enough that we no longer need a VS-specific code path. Fixes: #25378
-rw-r--r--Modules/CMakeDetermineCUDACompiler.cmake21
1 files changed, 1 insertions, 20 deletions
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake
index 585b2aa..6ac4dad 100644
--- a/Modules/CMakeDetermineCUDACompiler.cmake
+++ b/Modules/CMakeDetermineCUDACompiler.cmake
@@ -164,26 +164,7 @@ if(MSVC_CUDA_ARCHITECTURE_ID)
"set(MSVC_CUDA_ARCHITECTURE_ID ${MSVC_CUDA_ARCHITECTURE_ID})")
endif()
-if(CMAKE_GENERATOR MATCHES "Visual Studio")
- set(CMAKE_CUDA_HOST_LINK_LAUNCHER "${CMAKE_LINKER}")
- set(CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES "")
- set(CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES "")
- set(CMAKE_CUDA_HOST_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
-
- # We do not currently detect CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES but we
- # do need to detect CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT from the compiler by
- # looking at which cudart library exists in the implicit link libraries passed
- # to the host linker.
- if(CMAKE_CUDA_COMPILER_PRODUCED_OUTPUT MATCHES "link\\.exe [^\n]*cudart_static\\.lib")
- set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT "STATIC")
- elseif(CMAKE_CUDA_COMPILER_PRODUCED_OUTPUT MATCHES "link\\.exe [^\n]*cudart\\.lib")
- set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT "SHARED")
- else()
- set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT "NONE")
- endif()
- set(_SET_CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT
- "set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT \"${CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT}\")")
-elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang")
+if(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang")
string(REGEX MATCHALL "-target-cpu sm_([0-9]+)" _clang_target_cpus "${CMAKE_CUDA_COMPILER_PRODUCED_OUTPUT}")
foreach(_clang_target_cpu ${_clang_target_cpus})