From 945dd207b6ca6ca38e3b87247836eb1b3d5f8a77 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 13 Dec 2016 13:04:18 -0500 Subject: CUDA: Allow platform files to set device linking rules Condition the default settings on the rule variables not already being set. --- Modules/CMakeCUDAInformation.cmake | 13 ++++++++----- 1 file 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_COMPILE_OPTIONS_PIC} -shared -dlink -o ") -set(CMAKE_CUDA_DEVICE_LINK_EXECUTABLE - " ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} -shared -dlink -o ") - +if(NOT CMAKE_CUDA_DEVICE_LINK_LIBRARY) + set(CMAKE_CUDA_DEVICE_LINK_LIBRARY + " ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} -shared -dlink -o ") +endif() +if(NOT CMAKE_CUDA_DEVICE_LINK_EXECUTABLE) + set(CMAKE_CUDA_DEVICE_LINK_EXECUTABLE + " ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} -shared -dlink -o ") +endif() mark_as_advanced( CMAKE_CUDA_FLAGS -- cgit v0.12