summaryrefslogtreecommitdiff
path: root/Modules/Compiler/Clang-CUDA.cmake
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2021-11-06 12:54:07 +0200
committerRaul Tambre <raul@tambre.ee>2021-11-08 21:26:00 +0200
commit4707ecbe6fed1e135785f9fe9734a4c66807dd77 (patch)
tree1519f6d6bec23dcd2518284d030876e2c073f582 /Modules/Compiler/Clang-CUDA.cmake
parent15fde4c420e0fa469077fad020b9fdc071796f70 (diff)
downloadcmake-4707ecbe6fed1e135785f9fe9734a4c66807dd77.tar.gz
CUDA: Support CMP0105 on Clang
Add link flags during the "device compile" step. Enabled the relevant tests. The disable reasons regarding separable compilation were outdated and the actual failure case was device link flags support.
Diffstat (limited to 'Modules/Compiler/Clang-CUDA.cmake')
-rw-r--r--Modules/Compiler/Clang-CUDA.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/Compiler/Clang-CUDA.cmake b/Modules/Compiler/Clang-CUDA.cmake
index b105518e51..219897e4e1 100644
--- a/Modules/Compiler/Clang-CUDA.cmake
+++ b/Modules/Compiler/Clang-CUDA.cmake
@@ -22,6 +22,10 @@ set(_CMAKE_CUDA_WHOLE_FLAG "-c")
set(_CMAKE_CUDA_RDC_FLAG "-fgpu-rdc")
set(_CMAKE_CUDA_PTX_FLAG "--cuda-device-only -S")
+# Device linking is just regular linking so these are the same.
+set(CMAKE_CUDA_DEVICE_LINKER_WRAPPER_FLAG ${CMAKE_CUDA_LINKER_WRAPPER_FLAG})
+set(CMAKE_CUDA_DEVICE_LINKER_WRAPPER_FLAG_SEP ${CMAKE_CUDA_LINKER_WRAPPER_FLAG_SEP})
+
# RulePlaceholderExpander expands crosscompile variables like sysroot and target only for CMAKE_<LANG>_COMPILER. Override the default.
set(CMAKE_CUDA_LINK_EXECUTABLE "<CMAKE_CUDA_COMPILER> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
set(CMAKE_CUDA_CREATE_SHARED_LIBRARY "<CMAKE_CUDA_COMPILER> <CMAKE_SHARED_LIBRARY_CUDA_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")