summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-02-09 14:00:25 (GMT)
committerBrad King <brad.king@kitware.com>2024-02-09 14:00:46 (GMT)
commit1c05251433eef9eeca4e8624250682b968677e64 (patch)
treed0e6c40d4e6fdd5bc08aa8e63869d847118767a7
parent938a28637c0df7703006f7e87524626748c69cff (diff)
parent4a3cafec4ff195ec86ac60d693ec502b3fca58f2 (diff)
downloadCMake-1c05251433eef9eeca4e8624250682b968677e64.zip
CMake-1c05251433eef9eeca4e8624250682b968677e64.tar.gz
CMake-1c05251433eef9eeca4e8624250682b968677e64.tar.bz2
Merge topic 'FindCUDAToolkit-cudart-deps' into release-3.28
4a3cafec4f FindCUDAToolkit: Fix cudart dependencies Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9236
-rw-r--r--Modules/FindCUDAToolkit.cmake13
1 files changed, 5 insertions, 8 deletions
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake
index 469a7ad..6b8b08e 100644
--- a/Modules/FindCUDAToolkit.cmake
+++ b/Modules/FindCUDAToolkit.cmake
@@ -1136,18 +1136,12 @@ if(CUDAToolkit_FOUND)
_CUDAToolkit_find_and_add_import_lib(cuda_driver ALT cuda)
- _CUDAToolkit_find_and_add_import_lib(cudart)
- _CUDAToolkit_find_and_add_import_lib(cudart_static)
- # setup dependencies that are required for cudart_static when building
+ # setup dependencies that are required for cudart/cudart_static when building
# on linux. These are generally only required when using the CUDA toolkit
# when CUDA language is disabled
- if(NOT TARGET CUDA::cudart_static_deps
- AND TARGET CUDA::cudart_static)
-
+ if(NOT TARGET CUDA::cudart_static_deps)
add_library(CUDA::cudart_static_deps IMPORTED INTERFACE)
- target_link_libraries(CUDA::cudart_static INTERFACE CUDA::cudart_static_deps)
-
if(UNIX AND (CMAKE_C_COMPILER OR CMAKE_CXX_COMPILER))
find_package(Threads REQUIRED)
target_link_libraries(CUDA::cudart_static_deps INTERFACE Threads::Threads ${CMAKE_DL_LIBS})
@@ -1165,6 +1159,9 @@ if(CUDAToolkit_FOUND)
endif()
endif()
+ _CUDAToolkit_find_and_add_import_lib(cudart DEPS cudart_static_deps)
+ _CUDAToolkit_find_and_add_import_lib(cudart_static DEPS cudart_static_deps)
+
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 12.0.0)
_CUDAToolkit_find_and_add_import_lib(nvJitLink)
_CUDAToolkit_find_and_add_import_lib(nvJitLink_static DEPS cudart_static_deps)