mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 19:08:07 +08:00
CUDA: Error if can't determine toolkit library root
Finding the toolkit is required for Clang and is assumed to have been correctly found by FindCUDAToolkit if the CUDA language is found. Error out early with an useful error instead of failing later on due to the path not being set.
This commit is contained in:
@@ -183,6 +183,8 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN)
|
||||
set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "${CMAKE_SYSROOT_LINK}/usr/lib/cuda")
|
||||
elseif(EXISTS "${CMAKE_SYSROOT}/usr/lib/cuda/nvvm/libdevice")
|
||||
set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "${CMAKE_SYSROOT}/usr/lib/cuda")
|
||||
else()
|
||||
message(FATAL_ERROR "Couldn't find CUDA library root.")
|
||||
endif()
|
||||
|
||||
# CMAKE_CUDA_COMPILER_TOOLKIT_LIBRARY_ROOT contains the linking stubs necessary for device linking and other low-level library files.
|
||||
|
Reference in New Issue
Block a user