diff options
author | Brad King <brad.king@kitware.com> | 2017-06-21 13:35:16 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-06-21 14:41:49 (GMT) |
commit | fff782f6a64a64538254b23891dc00b18ecec4fe (patch) | |
tree | 3a291de2cc28ce0c66af0e2744ad4ed0bb82722f /Tests/CudaOnly/SeparateCompilation | |
parent | ad4a68cca00af3a20caaafbb96be67a1cc53a027 (diff) | |
download | CMake-fff782f6a64a64538254b23891dc00b18ecec4fe.zip CMake-fff782f6a64a64538254b23891dc00b18ecec4fe.tar.gz CMake-fff782f6a64a64538254b23891dc00b18ecec4fe.tar.bz2 |
Tests: Simplify CUDA rpath on macOS
Use the `BUILD_RPATH` property and reference the CMake-computed location
of the runtime libraries.
Diffstat (limited to 'Tests/CudaOnly/SeparateCompilation')
-rw-r--r-- | Tests/CudaOnly/SeparateCompilation/CMakeLists.txt | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt index 0a2542a..55fd79f 100644 --- a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt +++ b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt @@ -39,8 +39,7 @@ if (CMAKE_GENERATOR MATCHES "^Visual Studio") PROPERTIES CUDA_SEPARABLE_COMPILATION ON) endif() -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(CudaOnlySeparateCompilation PRIVATE -Wl,-rpath,/usr/local/cuda/lib) +if(APPLE) + # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime. + set_property(TARGET CudaOnlySeparateCompilation PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}) endif() |