fix: propagate CUDA driver dependency to shared library consumers

This commit is contained in:
leejet committed 2026-09-19 18:04:59 +08:00
1 parent 3e037a81e4
commit 9982c9caae
2 files changed
+4 -3

No files matched your search

+2 -1
View File
@@ -345,7 +345,8 @@ target_link_libraries(${SD_LIB} PUBLIC ggml)
target_link_libraries(${SD_LIB} PRIVATE onig sd-utf8proc)
if (SD_CUDA)
find_package(CUDAToolkit REQUIRED)
target_link_libraries(${SD_LIB} PRIVATE CUDA::cuda_driver)
# Keep the driver stub on downstream link lines when no driver is installed.
target_link_libraries(${SD_LIB} PUBLIC CUDA::cuda_driver)
set_property(SOURCE src/core/ggml_extend_backend.cpp APPEND PROPERTY COMPILE_DEFINITIONS SD_USE_CUDA)
endif()
target_include_directories(${SD_LIB} PUBLIC . src include)