diff options
author | Brad King <brad.king@kitware.com> | 2023-09-14 15:45:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-09-21 19:34:27 (GMT) |
commit | f125dfcd302dcc65547c8f67390187f92f696e49 (patch) | |
tree | 0fddbc61e4e5d577c0eb8a2c979119fed7f35f7d /Modules | |
parent | d08b7f3cdab24a21b3da3c43b6d0d9f256f76f77 (diff) | |
download | CMake-f125dfcd302dcc65547c8f67390187f92f696e49.zip CMake-f125dfcd302dcc65547c8f67390187f92f696e49.tar.gz CMake-f125dfcd302dcc65547c8f67390187f92f696e49.tar.bz2 |
CUDA: Clarify order of logic finding CUDA Toolkit for compiler
Finish all the search logic before using any results.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDetermineCUDACompiler.cmake | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake index 734b039..1ddb7ba 100644 --- a/Modules/CMakeDetermineCUDACompiler.cmake +++ b/Modules/CMakeDetermineCUDACompiler.cmake @@ -211,9 +211,6 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN) endif() unset(_CUDA_NVCC_OUT) - set(CMAKE_CUDA_DEVICE_LINKER "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/bin/nvlink${CMAKE_EXECUTABLE_SUFFIX}") - set(CMAKE_CUDA_FATBINARY "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/bin/fatbinary${CMAKE_EXECUTABLE_SUFFIX}") - # In a non-scattered installation the following are equivalent to CMAKE_CUDA_COMPILER_TOOLKIT_ROOT. # We first check for a non-scattered installation to prefer it over a scattered installation. @@ -252,6 +249,9 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN) # Don't leak variables unnecessarily to user code. unset(_CUDA_NVCC_EXECUTABLE) + + set(CMAKE_CUDA_DEVICE_LINKER "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/bin/nvlink${CMAKE_EXECUTABLE_SUFFIX}") + set(CMAKE_CUDA_FATBINARY "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/bin/fatbinary${CMAKE_EXECUTABLE_SUFFIX}") endif() set(CMAKE_CUDA_COMPILER_ID_FLAGS_ALWAYS "-v") |