summaryrefslogtreecommitdiff
path: root/Modules/CMakeDetermineCUDACompiler.cmake
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:20:27 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:20:27 +0900
commitf7fbee1ce7e4f73a5a46681cf010a9ac85c3ad87 (patch)
treea0d779b32b006b5dbbc54a95cce0cd5d0309eebf /Modules/CMakeDetermineCUDACompiler.cmake
parent50e508f0913d5580aa156327527da3d29a66b90c (diff)
downloadcmake-f7fbee1ce7e4f73a5a46681cf010a9ac85c3ad87.tar.gz
cmake-f7fbee1ce7e4f73a5a46681cf010a9ac85c3ad87.tar.bz2
cmake-f7fbee1ce7e4f73a5a46681cf010a9ac85c3ad87.zip
Imported Upstream version 3.19.1upstream/3.19.1
Diffstat (limited to 'Modules/CMakeDetermineCUDACompiler.cmake')
-rw-r--r--Modules/CMakeDetermineCUDACompiler.cmake10
1 files changed, 6 insertions, 4 deletions
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake
index 9220551f3..972adefd1 100644
--- a/Modules/CMakeDetermineCUDACompiler.cmake
+++ b/Modules/CMakeDetermineCUDACompiler.cmake
@@ -176,13 +176,15 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN)
# 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.
- # CMAKE_CUDA_COMPILER_LIBRARY_ROOT contains the device library and version file.
- if(EXISTS "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/version.txt")
+ # CMAKE_CUDA_COMPILER_LIBRARY_ROOT contains the device library.
+ if(EXISTS "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/nvvm/libdevice")
set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}")
- elseif(CMAKE_SYSROOT_LINK AND EXISTS "${CMAKE_SYSROOT_LINK}/usr/lib/cuda/version.txt")
+ elseif(CMAKE_SYSROOT_LINK AND EXISTS "${CMAKE_SYSROOT_LINK}/usr/lib/cuda/nvvm/libdevice")
set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "${CMAKE_SYSROOT_LINK}/usr/lib/cuda")
- elseif(EXISTS "${CMAKE_SYSROOT}/usr/lib/cuda/version.txt")
+ 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.