summaryrefslogtreecommitdiff
path: root/Modules/CMakeDetermineCUDACompiler.cmake
diff options
context:
space:
mode:
authorsamuel100u <hsm100u@cs.ccu.edu.tw>2021-09-30 17:54:02 +0800
committerBrad King <brad.king@kitware.com>2021-09-30 09:33:17 -0400
commita1f0ddcbb724914005b74ca181bfd1da391df7c7 (patch)
tree2d3b7026b48dc382d3e41eeaa87b42536fab55b3 /Modules/CMakeDetermineCUDACompiler.cmake
parent32818510c885a50ec611333b657f58d3be28c5bc (diff)
downloadcmake-a1f0ddcbb724914005b74ca181bfd1da391df7c7.tar.gz
CUDA: Fix detection of implicit link information with CUDA 6.5
Fixes: #22701
Diffstat (limited to 'Modules/CMakeDetermineCUDACompiler.cmake')
-rw-r--r--Modules/CMakeDetermineCUDACompiler.cmake5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake
index 342425c50e..d06315e479 100644
--- a/Modules/CMakeDetermineCUDACompiler.cmake
+++ b/Modules/CMakeDetermineCUDACompiler.cmake
@@ -441,9 +441,10 @@ elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
if("${_nvcc_output_line}" MATCHES "^ *nvlink")
string(APPEND _nvcc_log " ignoring nvlink line\n")
elseif(_nvcc_libraries)
- if("${_nvcc_output_line}" MATCHES "(@\"?tmp/a\\.exe\\.res\"?)")
+ if("${_nvcc_output_line}" MATCHES "(@\"?((tmp/)?a\\.exe\\.res)\"?)")
set(_nvcc_link_res_arg "${CMAKE_MATCH_1}")
- set(_nvcc_link_res "${CMAKE_PLATFORM_INFO_DIR}/CompilerIdCUDA/tmp/a.exe.res")
+ set(_nvcc_link_res_file "${CMAKE_MATCH_2}")
+ set(_nvcc_link_res "${CMAKE_PLATFORM_INFO_DIR}/CompilerIdCUDA/${_nvcc_link_res_file}")
if(EXISTS "${_nvcc_link_res}")
file(READ "${_nvcc_link_res}" _nvcc_link_res_content)
string(REPLACE "${_nvcc_link_res_arg}" "${_nvcc_link_res_content}" _nvcc_output_line "${_nvcc_output_line}")