summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCUDACompiler.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-12-13 18:05:20 (GMT)
committerBrad King <brad.king@kitware.com>2017-01-12 15:39:03 (GMT)
commit522b913f437b04aa10b84cb5807ab43181377d7e (patch)
tree59a594fbcd691f6e9803eab137b4a4eea0b65358 /Modules/CMakeDetermineCUDACompiler.cmake
parent02582b91ad92969d8fbbd845a5d48b3fbd762966 (diff)
downloadCMake-522b913f437b04aa10b84cb5807ab43181377d7e.zip
CMake-522b913f437b04aa10b84cb5807ab43181377d7e.tar.gz
CMake-522b913f437b04aa10b84cb5807ab43181377d7e.tar.bz2
CUDA: Find MSVC binutils on Windows
On Windows the host link launcher is just `link.exe`. Find and use that instead of trying to extract the launcher from the `nvcc -v` output.
Diffstat (limited to 'Modules/CMakeDetermineCUDACompiler.cmake')
-rw-r--r--Modules/CMakeDetermineCUDACompiler.cmake10
1 files changed, 7 insertions, 3 deletions
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake
index d3024c7..22c53d9 100644
--- a/Modules/CMakeDetermineCUDACompiler.cmake
+++ b/Modules/CMakeDetermineCUDACompiler.cmake
@@ -116,9 +116,13 @@ if(CMAKE_CUDA_COMPILER_ID STREQUAL NVIDIA)
endif()
if(_nvcc_link_line)
- #extract the compiler that is being used for linking
- separate_arguments(_nvcc_link_line_args UNIX_COMMAND "${_nvcc_link_line}")
- list(GET _nvcc_link_line_args 0 CMAKE_CUDA_HOST_LINK_LAUNCHER)
+ if("x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC")
+ set(CMAKE_CUDA_HOST_LINK_LAUNCHER "${CMAKE_LINKER}")
+ else()
+ #extract the compiler that is being used for linking
+ separate_arguments(_nvcc_link_line_args UNIX_COMMAND "${_nvcc_link_line}")
+ list(GET _nvcc_link_line_args 0 CMAKE_CUDA_HOST_LINK_LAUNCHER)
+ endif()
#prefix the line with cuda-fake-ld so that implicit link info believes it is
#a link line