summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-12-13 18:04:18 (GMT)
committerBrad King <brad.king@kitware.com>2017-01-12 15:39:02 (GMT)
commit945dd207b6ca6ca38e3b87247836eb1b3d5f8a77 (patch)
tree3c1001dc789485decef82b80008acdfc23d990ff /Modules
parent95420cea5e12d21957a50dae20f90c2e83571758 (diff)
downloadCMake-945dd207b6ca6ca38e3b87247836eb1b3d5f8a77.zip
CMake-945dd207b6ca6ca38e3b87247836eb1b3d5f8a77.tar.gz
CMake-945dd207b6ca6ca38e3b87247836eb1b3d5f8a77.tar.bz2
CUDA: Allow platform files to set device linking rules
Condition the default settings on the rule variables not already being set.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeCUDAInformation.cmake13
1 files changed, 8 insertions, 5 deletions
diff --git a/Modules/CMakeCUDAInformation.cmake b/Modules/CMakeCUDAInformation.cmake
index 202a7a6..cb0eef5 100644
--- a/Modules/CMakeCUDAInformation.cmake
+++ b/Modules/CMakeCUDAInformation.cmake
@@ -177,11 +177,14 @@ if(NOT CMAKE_CUDA_LINK_EXECUTABLE)
endif()
#These are used when linking relocatable (dc) cuda code
-set(CMAKE_CUDA_DEVICE_LINK_LIBRARY
- "<CMAKE_CUDA_COMPILER> <CMAKE_CUDA_LINK_FLAGS> <LANGUAGE_COMPILE_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
-set(CMAKE_CUDA_DEVICE_LINK_EXECUTABLE
- "<CMAKE_CUDA_COMPILER> <CMAKE_CUDA_LINK_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
-
+if(NOT CMAKE_CUDA_DEVICE_LINK_LIBRARY)
+ set(CMAKE_CUDA_DEVICE_LINK_LIBRARY
+ "<CMAKE_CUDA_COMPILER> <CMAKE_CUDA_LINK_FLAGS> <LANGUAGE_COMPILE_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+endif()
+if(NOT CMAKE_CUDA_DEVICE_LINK_EXECUTABLE)
+ set(CMAKE_CUDA_DEVICE_LINK_EXECUTABLE
+ "<CMAKE_CUDA_COMPILER> <CMAKE_CUDA_LINK_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+endif()
mark_as_advanced(
CMAKE_CUDA_FLAGS