diff options
author | Brad King <brad.king@kitware.com> | 2020-09-22 11:40:28 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-09-22 11:40:34 (GMT) |
commit | cedc0a0329333254dfbbe235e168e0fe0cbc8023 (patch) | |
tree | 739e7c11a622446c4f1ad40d6a3d21c0a2b2a3f3 | |
parent | 13a326536befb6327dd36ce9ad0177b4c709072d (diff) | |
parent | 9d3f7872e14f1b27b4fb6b9e05bdbb455fb76c2f (diff) | |
download | CMake-cedc0a0329333254dfbbe235e168e0fe0cbc8023.zip CMake-cedc0a0329333254dfbbe235e168e0fe0cbc8023.tar.gz CMake-cedc0a0329333254dfbbe235e168e0fe0cbc8023.tar.bz2 |
Merge topic 'findcudatoolkit_cross_scattered'
9d3f7872e1 FindCUDAToolkit: Support scattered installations when crosscompiling
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5247
-rw-r--r-- | Help/release/dev/cuda-clang-scattered-cross.rst | 5 | ||||
-rw-r--r-- | Help/release/dev/cuda-scattered-cross.rst | 7 | ||||
-rw-r--r-- | Modules/FindCUDAToolkit.cmake | 9 |
3 files changed, 12 insertions, 9 deletions
diff --git a/Help/release/dev/cuda-clang-scattered-cross.rst b/Help/release/dev/cuda-clang-scattered-cross.rst deleted file mode 100644 index 7278dcb..0000000 --- a/Help/release/dev/cuda-clang-scattered-cross.rst +++ /dev/null @@ -1,5 +0,0 @@ -cuda-clang-scattered-cross --------------------------- - -* Scattered toolkit installations are now recognized when crosscompiling - ``CUDA`` using Clang. diff --git a/Help/release/dev/cuda-scattered-cross.rst b/Help/release/dev/cuda-scattered-cross.rst new file mode 100644 index 0000000..a76407c --- /dev/null +++ b/Help/release/dev/cuda-scattered-cross.rst @@ -0,0 +1,7 @@ +cuda-scattered-cross +-------------------- + +* Scattered toolkit installations are now recognized when crosscompiling + ``CUDA`` using Clang. +* :module:`FindCUDAToolkit` now finds scattered toolkit installations when + crosscompiling. diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake index 1054f60..b4599a3 100644 --- a/Modules/FindCUDAToolkit.cmake +++ b/Modules/FindCUDAToolkit.cmake @@ -668,16 +668,14 @@ else() unset(_CUDAToolkit_version_file) endif() -# Handle cross compilation +# Find target directory when crosscompiling. if(CMAKE_CROSSCOMPILING) if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a") # Support for NVPACK set(CUDAToolkit_TARGET_NAME "armv7-linux-androideabi") elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm") - # Support for arm cross compilation set(CUDAToolkit_TARGET_NAME "armv7-linux-gnueabihf") elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") - # Support for aarch64 cross compilation if(ANDROID_ARCH_NAME STREQUAL "arm64") set(CUDAToolkit_TARGET_NAME "aarch64-linux-androideabi") else() @@ -698,7 +696,10 @@ if(CMAKE_CROSSCOMPILING) # PATh set(_CUDAToolkit_Pop_ROOT_PATH True) endif() -else() +endif() + +# If not already set we can simply use the toolkit root or it's a scattered installation. +if(NOT CUDAToolkit_TARGET_DIR) # Not cross compiling set(CUDAToolkit_TARGET_DIR "${CUDAToolkit_ROOT_DIR}") # Now that we have the real ROOT_DIR, find components inside it. |