mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-08 07:10:12 -05:00
CUDA: Support scattered installations when crosscompiling with Clang
Previously when CMAKE_CROSSCOMPILING was ON we'd end up not setting the target directory if the non-scattered one didn't exist. Fix this by assuming a scattered installation if the target directory isn't set after the crosscompiling logic.
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
cuda-clang-scattered-cross
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
* Scattered toolkit installations are now recognized when crosscompiling
|
||||||
|
``CUDA`` using Clang.
|
||||||
@@ -300,7 +300,7 @@ elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang")
|
|||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Find target directory. Account for crosscompiling.
|
# Find target directory when crosscompiling.
|
||||||
if(CMAKE_CROSSCOMPILING)
|
if(CMAKE_CROSSCOMPILING)
|
||||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a")
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a")
|
||||||
# Support for NVPACK
|
# 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}")
|
if(EXISTS "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/targets/${_CUDA_TARGET_NAME}")
|
||||||
set(_CUDA_TARGET_DIR "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/targets/${_CUDA_TARGET_NAME}")
|
set(_CUDA_TARGET_DIR "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/targets/${_CUDA_TARGET_NAME}")
|
||||||
endif()
|
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}")
|
set(_CUDA_TARGET_DIR "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user