summaryrefslogtreecommitdiffstats
path: root/Tests/CudaOnly/CMakeLists.txt
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2018-03-27 18:59:34 (GMT)
committerBrad King <brad.king@kitware.com>2018-03-28 13:38:43 (GMT)
commit41eab150a8ef42bbebff18ff84652e9da1ef4e75 (patch)
tree80799f497ace9a2151b7d900e4f71fadf8353443 /Tests/CudaOnly/CMakeLists.txt
parent88c7abb7409c235d411c4cc899377385b91075e2 (diff)
downloadCMake-41eab150a8ef42bbebff18ff84652e9da1ef4e75.zip
CMake-41eab150a8ef42bbebff18ff84652e9da1ef4e75.tar.gz
CMake-41eab150a8ef42bbebff18ff84652e9da1ef4e75.tar.bz2
CUDA: Pass more link libraries to device linking
Previously we dropped non-target items from the device link line because nvcc rejects paths to shared library files, and only with target items do we know the kind of library. However, this also prevents projects from linking to system-provided libraries like `cublas_device` that contain device code. Fix this by passing more link items to device linking. Items that are not file paths, such as `-lfoo`, can simply be passed unconditionally. Items that are targets known to be shared libraries can still be skipped. Items that are paths to library files can be passed directly if they end in `.a`. Otherwise, pass them using `-Xnvlink` to bypass nvcc's front-end. The nvlink tool knows to ignore shared library files. Issue: #16317
Diffstat (limited to 'Tests/CudaOnly/CMakeLists.txt')
-rw-r--r--Tests/CudaOnly/CMakeLists.txt1
1 files changed, 1 insertions, 0 deletions
diff --git a/Tests/CudaOnly/CMakeLists.txt b/Tests/CudaOnly/CMakeLists.txt
index 5ad6e6b..565baca 100644
--- a/Tests/CudaOnly/CMakeLists.txt
+++ b/Tests/CudaOnly/CMakeLists.txt
@@ -2,6 +2,7 @@
ADD_TEST_MACRO(CudaOnly.EnableStandard CudaOnlyEnableStandard)
ADD_TEST_MACRO(CudaOnly.ExportPTX CudaOnlyExportPTX)
ADD_TEST_MACRO(CudaOnly.GPUDebugFlag CudaOnlyGPUDebugFlag)
+ADD_TEST_MACRO(CudaOnly.LinkSystemDeviceLibraries CudaOnlyLinkSystemDeviceLibraries)
ADD_TEST_MACRO(CudaOnly.ResolveDeviceSymbols CudaOnlyResolveDeviceSymbols)
ADD_TEST_MACRO(CudaOnly.SeparateCompilation CudaOnlySeparateCompilation)
ADD_TEST_MACRO(CudaOnly.WithDefs CudaOnlyWithDefs)