summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeCUDACompiler.cmake.in
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2017-01-05 21:31:36 (GMT)
committerBrad King <brad.king@kitware.com>2017-01-12 20:13:36 (GMT)
commit8d1f9e5b850e02d304e4c209e720f06e25837470 (patch)
tree35e787859dc2a9e3bc4ebb9eb6fcd8a666f09e9c /Modules/CMakeCUDACompiler.cmake.in
parentdc5051f1c1b7604b9c05e04bdccdff222b69efa0 (diff)
downloadCMake-8d1f9e5b850e02d304e4c209e720f06e25837470.zip
CMake-8d1f9e5b850e02d304e4c209e720f06e25837470.tar.gz
CMake-8d1f9e5b850e02d304e4c209e720f06e25837470.tar.bz2
CUDA: Now pass correct FLAGS when device link cuda executables.
Previously we had a two issues when building cuda executables that required separable compilation. The first was that we didn't propagate FLAGS causing any -arch / -gencode flags to be dropped, and secondly generators such as ninja would use the CXX language flags instead of CUDA when the executable was mixed language.
Diffstat (limited to 'Modules/CMakeCUDACompiler.cmake.in')
-rw-r--r--Modules/CMakeCUDACompiler.cmake.in2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/CMakeCUDACompiler.cmake.in b/Modules/CMakeCUDACompiler.cmake.in
index 1ba42d9..7e8efa7 100644
--- a/Modules/CMakeCUDACompiler.cmake.in
+++ b/Modules/CMakeCUDACompiler.cmake.in
@@ -13,6 +13,8 @@ set(CMAKE_CUDA_HOST_COMPILER_ENV_VAR "CUDAHOSTCXX")
set(CMAKE_CUDA_COMPILER_ID_RUN 1)
set(CMAKE_CUDA_SOURCE_FILE_EXTENSIONS cu)
+set(CMAKE_CUDA_LINKER_PREFERENCE 10)
+set(CMAKE_CUDA_LINKER_PREFERENCE_PROPAGATES 1)
set(CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES "@CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES@")
set(CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES@")