mirror of
https://github.com/reactos/CMake.git
synced 2025-02-26 06:55:34 +00:00
CUDAToolkit: Gracefully handle missing SDK components
This commit is contained in:
parent
e500eb80cd
commit
907bb7df57
@ -708,9 +708,13 @@ if(CUDAToolkit_FOUND)
|
||||
endfunction()
|
||||
|
||||
function(add_cuda_link_dependency lib_name)
|
||||
foreach(dependency IN LISTS ARGN)
|
||||
target_link_libraries(CUDA::${lib_name} INTERFACE CUDA::${dependency})
|
||||
endforeach()
|
||||
if(TARGET CUDA::${lib_name})
|
||||
foreach(dependency IN LISTS ARGN)
|
||||
if(TARGET CUDA::${dependency})
|
||||
target_link_libraries(CUDA::${lib_name} INTERFACE CUDA::${dependency})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
add_library(CUDA::toolkit IMPORTED INTERFACE)
|
||||
@ -742,9 +746,6 @@ if(CUDAToolkit_FOUND)
|
||||
find_and_add_cuda_import_lib(nppc)
|
||||
find_and_add_cuda_import_lib(nppc_static)
|
||||
|
||||
add_cuda_link_dependency(nppc cudart)
|
||||
add_cuda_link_dependency(nppc_static cudart_static culibos)
|
||||
|
||||
# Process the majority of the NPP libraries.
|
||||
foreach (cuda_lib nppial nppicc nppidei nppif nppig nppim nppist nppitc npps nppicom nppisu)
|
||||
find_and_add_cuda_import_lib(${cuda_lib})
|
||||
@ -777,7 +778,7 @@ if(CUDAToolkit_FOUND)
|
||||
|
||||
find_and_add_cuda_import_lib(culibos)
|
||||
if(TARGET CUDA::culibos)
|
||||
foreach (cuda_lib cublas cufft cusparse curand nvjpeg)
|
||||
foreach (cuda_lib cublas cufft cusparse curand nppc nvjpeg)
|
||||
add_cuda_link_dependency(${cuda_lib}_static culibos)
|
||||
endforeach()
|
||||
endif()
|
||||
|
Loading…
x
Reference in New Issue
Block a user