diff options
author | Raul Tambre <raul@tambre.ee> | 2020-09-20 14:30:35 (GMT) |
---|---|---|
committer | Raul Tambre <raul@tambre.ee> | 2020-09-20 14:35:12 (GMT) |
commit | 9d3f7872e14f1b27b4fb6b9e05bdbb455fb76c2f (patch) | |
tree | 3059b1806becc5207ec78ba903105973f7b748a6 /Modules | |
parent | 39a5c0c82c2041a622bcdf19fa3f22abc34b9ae8 (diff) | |
download | CMake-9d3f7872e14f1b27b4fb6b9e05bdbb455fb76c2f.zip CMake-9d3f7872e14f1b27b4fb6b9e05bdbb455fb76c2f.tar.gz CMake-9d3f7872e14f1b27b4fb6b9e05bdbb455fb76c2f.tar.bz2 |
FindCUDAToolkit: Support scattered installations when crosscompiling
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 is the same fix as commit 2c0d5d01ee (CUDA: Support scattered
installations when crosscompiling with Clang, 2020-09-14).
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindCUDAToolkit.cmake | 9 |
1 files changed, 5 insertions, 4 deletions
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. |