diff options
author | Raul Tambre <raul@tambre.ee> | 2020-11-22 09:10:48 (GMT) |
---|---|---|
committer | Raul Tambre <raul@tambre.ee> | 2020-11-22 09:30:01 (GMT) |
commit | 046e454fdd7bf624608f867e032bc88919b86d88 (patch) | |
tree | c2ce2b2e87c266a149933d39f021a85ff38c62c9 /Modules/CMakeDetermineCUDACompiler.cmake | |
parent | 440dc98b07d89d3c45c19a9c4ddfbf264081600b (diff) | |
download | CMake-046e454fdd7bf624608f867e032bc88919b86d88.zip CMake-046e454fdd7bf624608f867e032bc88919b86d88.tar.gz CMake-046e454fdd7bf624608f867e032bc88919b86d88.tar.bz2 |
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.
Diffstat (limited to 'Modules/CMakeDetermineCUDACompiler.cmake')
-rw-r--r-- | Modules/CMakeDetermineCUDACompiler.cmake | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake index 781c590..972adef 100644 --- a/Modules/CMakeDetermineCUDACompiler.cmake +++ b/Modules/CMakeDetermineCUDACompiler.cmake @@ -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. |