summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-15 11:56:19 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-09-15 11:56:25 (GMT)
commit2d661d9ddd0e3bbb52cba990e1afae52edbf06ad (patch)
tree49dea16d6d6f4b22f5ce536c8178531c6d30851a /Modules
parentfa910f51fd2cab5f60fa1926abe9540f3b010987 (diff)
parent2c0d5d01ee8b129116acec2fb359e7e6514876cb (diff)
downloadCMake-2d661d9ddd0e3bbb52cba990e1afae52edbf06ad.zip
CMake-2d661d9ddd0e3bbb52cba990e1afae52edbf06ad.tar.gz
CMake-2d661d9ddd0e3bbb52cba990e1afae52edbf06ad.tar.bz2
Merge topic 'cuda_clang_scattered_cross'
2c0d5d01ee CUDA: Support scattered installations when crosscompiling with Clang Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5222
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeDetermineCUDACompiler.cmake7
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake
index 6bdd06b..e60a973 100644
--- a/Modules/CMakeDetermineCUDACompiler.cmake
+++ b/Modules/CMakeDetermineCUDACompiler.cmake
@@ -300,7 +300,7 @@ elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang")
endforeach()
endif()
- # Find target directory. Account for crosscompiling.
+ # Find target directory when crosscompiling.
if(CMAKE_CROSSCOMPILING)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a")
# Support for NVPACK
@@ -320,7 +320,10 @@ elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang")
if(EXISTS "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/targets/${_CUDA_TARGET_NAME}")
set(_CUDA_TARGET_DIR "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/targets/${_CUDA_TARGET_NAME}")
endif()
- else()
+ endif()
+
+ # If not already set we can simply use the toolkit root or it's a scattered installation.
+ if(NOT _CUDA_TARGET_DIR)
set(_CUDA_TARGET_DIR "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}")
endif()