Skip to content

Commit

Permalink
cmake: expose CUDA::cuda_driver dependency in use
Browse files Browse the repository at this point in the history
Without this, CUDA::cuda_driver target is not linked to libocca during
consumption and as a result there is a build problem: libcuda.so cannot
be found. This occurs on machines which do not have CUDA lib default,
 compiler included libraries (e.g. in /lib64)
  • Loading branch information
nsoborin authored and kris-rowe committed Jan 30, 2024
1 parent 6390b2d commit 72cc774
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ if(OCCA_ENABLE_CUDA)
message("-- CUDA driver library: ${CUDAToolkit_LIBRARY_DIR}")

# Use the provided imported target CUDA::cuda_driver, to make our package relocatable
target_link_libraries(libocca PRIVATE CUDA::cuda_driver)
target_link_libraries(libocca PUBLIC CUDA::cuda_driver)
else()
set(OCCA_CUDA_ENABLED 0)
endif()
Expand Down

0 comments on commit 72cc774

Please sign in to comment.