From ce19607fed3990b8e828330e77f09061c99aa113 Mon Sep 17 00:00:00 2001 From: Pierre Moreau Date: Thu, 2 Feb 2017 22:38:32 +0100 Subject: Tests/Cuda: Fix missing CUDA static library at runtime on macOS Suggested-by: Robert Maynard --- Tests/Cuda/Complex/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Tests/Cuda/Complex/CMakeLists.txt b/Tests/Cuda/Complex/CMakeLists.txt index 9a3703a..14454cf 100644 --- a/Tests/Cuda/Complex/CMakeLists.txt +++ b/Tests/Cuda/Complex/CMakeLists.txt @@ -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() -- cgit v0.12