summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-05-22 10:55:22 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-05-22 10:55:37 (GMT)
commitb54280beb7d32976269d037edfb06b60d6ce0862 (patch)
treed0bf21c46d31812322203a889ee508a637b257b3 /Tests
parent23acffe5ddadea24db999e34081544cb1bc40823 (diff)
parentd8eee80e3091ebdc1af2208ec6e94d885b279be9 (diff)
downloadCMake-b54280beb7d32976269d037edfb06b60d6ce0862.zip
CMake-b54280beb7d32976269d037edfb06b60d6ce0862.tar.gz
CMake-b54280beb7d32976269d037edfb06b60d6ce0862.tar.bz2
Merge topic 'cuda-default-runtime'
d8eee80e30 Merge branch 'backport-cuda-default-runtime' into cuda-default-runtime e55b21e24e CUDA: Compute CMAKE_CUDA_RUNTIME_LIBRARY default from toolchain 1086e930dc CUDA: Propagate CMAKE_CUDA_RUNTIME_LIBRARY state to try_compile a4ea293153 Help: Correct CMAKE_CUDA_RUNTIME_LIBRARY applicability Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4762
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CudaOnly/CMakeLists.txt2
-rw-r--r--Tests/CudaOnly/SharedRuntimeViaCUDAFlags/CMakeLists.txt15
-rw-r--r--Tests/CudaOnly/SharedRuntimeViaCUDAFlags/main.cu5
3 files changed, 22 insertions, 0 deletions
diff --git a/Tests/CudaOnly/CMakeLists.txt b/Tests/CudaOnly/CMakeLists.txt
index 69190c7..8244b91 100644
--- a/Tests/CudaOnly/CMakeLists.txt
+++ b/Tests/CudaOnly/CMakeLists.txt
@@ -9,6 +9,8 @@ ADD_TEST_MACRO(CudaOnly.Toolkit CudaOnlyToolkit)
ADD_TEST_MACRO(CudaOnly.WithDefs CudaOnlyWithDefs)
if(CMake_TEST_CUDA AND NOT CMake_TEST_CUDA STREQUAL "Clang")
+ ADD_TEST_MACRO(CudaOnly.SharedRuntimeViaCUDAFlags CudaOnlySharedRuntimeViaCUDAFlags)
+
# Separable compilation is currently only supported on NVCC. Disable tests
# using it for other compilers.
ADD_TEST_MACRO(CudaOnly.CircularLinkLine CudaOnlyCircularLinkLine)
diff --git a/Tests/CudaOnly/SharedRuntimeViaCUDAFlags/CMakeLists.txt b/Tests/CudaOnly/SharedRuntimeViaCUDAFlags/CMakeLists.txt
new file mode 100644
index 0000000..24ff478
--- /dev/null
+++ b/Tests/CudaOnly/SharedRuntimeViaCUDAFlags/CMakeLists.txt
@@ -0,0 +1,15 @@
+cmake_minimum_required(VERSION 3.17)
+project(SharedRuntimeViaCUDAFlags NONE)
+
+set(CMAKE_CUDA_FLAGS "")
+string(APPEND CMAKE_CUDA_FLAGS "-cudart shared")
+
+enable_language(CUDA)
+
+add_executable(CudaOnlySharedRuntimeViaCUDAFlags main.cu)
+
+if(UNIX)
+ # Help the shared cuda runtime find libcudart as it is not located
+ # in a default system searched location
+ set_property(TARGET CudaOnlySharedRuntimeViaCUDAFlags PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
+endif()
diff --git a/Tests/CudaOnly/SharedRuntimeViaCUDAFlags/main.cu b/Tests/CudaOnly/SharedRuntimeViaCUDAFlags/main.cu
new file mode 100644
index 0000000..766b775
--- /dev/null
+++ b/Tests/CudaOnly/SharedRuntimeViaCUDAFlags/main.cu
@@ -0,0 +1,5 @@
+
+int main()
+{
+ return 0;
+}