Tests/Cuda: Fix missing CUDA static library at runtime on macOS

Suggested-by: Robert Maynard
This commit is contained in:
Pierre Moreau
2017-02-02 22:38:32 +01:00
committed by Brad King
parent 008ed80dcf
commit ce19607fed

View File

@@ -38,3 +38,9 @@ target_link_libraries(CudaComplexMixedLib
add_executable(CudaComplex main.cpp)
target_link_libraries(CudaComplex PUBLIC CudaComplexMixedLib)
if(APPLE)
# We need to add the default path to the driver (libcuda.dylib) as an rpath, so that
# the static cuda runtime can find it at runtime.
target_link_libraries(CudaComplex PRIVATE -Wl,-rpath,/usr/local/cuda/lib)
endif()