diff options
-rw-r--r-- | Help/release/dev/FindCUDAToolkit-arm64-sbsa.rst | 4 | ||||
-rw-r--r-- | Modules/FindCUDAToolkit.cmake | 39 |
2 files changed, 25 insertions, 18 deletions
diff --git a/Help/release/dev/FindCUDAToolkit-arm64-sbsa.rst b/Help/release/dev/FindCUDAToolkit-arm64-sbsa.rst new file mode 100644 index 0000000..55ddb99 --- /dev/null +++ b/Help/release/dev/FindCUDAToolkit-arm64-sbsa.rst @@ -0,0 +1,4 @@ +FindCUDAToolkit-arm64-sbsa +-------------------------- + +* The :module:`FindCUDAToolkit` gained support for the `sbsa-linux` cross compilation target diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake index ea30bea..d621195 100644 --- a/Modules/FindCUDAToolkit.cmake +++ b/Modules/FindCUDAToolkit.cmake @@ -795,32 +795,35 @@ endif() if(CMAKE_CROSSCOMPILING) if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a") # Support for NVPACK - set(CUDAToolkit_TARGET_NAME "armv7-linux-androideabi") + set(CUDAToolkit_TARGET_NAMES "armv7-linux-androideabi") elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm") - set(CUDAToolkit_TARGET_NAME "armv7-linux-gnueabihf") + set(CUDAToolkit_TARGET_NAMES "armv7-linux-gnueabihf") elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") if(ANDROID_ARCH_NAME STREQUAL "arm64") - set(CUDAToolkit_TARGET_NAME "aarch64-linux-androideabi") + set(CUDAToolkit_TARGET_NAMES "aarch64-linux-androideabi") elseif (CMAKE_SYSTEM_NAME STREQUAL "QNX") - set(CUDAToolkit_TARGET_NAME "aarch64-qnx") + set(CUDAToolkit_TARGET_NAMES "aarch64-qnx") else() - set(CUDAToolkit_TARGET_NAME "aarch64-linux") - endif(ANDROID_ARCH_NAME STREQUAL "arm64") + set(CUDAToolkit_TARGET_NAMES "aarch64-linux" "sbsa-linux") + endif() elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") - set(CUDAToolkit_TARGET_NAME "x86_64-linux") + set(CUDAToolkit_TARGET_NAMES "x86_64-linux") endif() - if(EXISTS "${CUDAToolkit_ROOT_DIR}/targets/${CUDAToolkit_TARGET_NAME}") - set(CUDAToolkit_TARGET_DIR "${CUDAToolkit_ROOT_DIR}/targets/${CUDAToolkit_TARGET_NAME}") - # add known CUDA target root path to the set of directories we search for programs, libraries and headers - list(PREPEND CMAKE_FIND_ROOT_PATH "${CUDAToolkit_TARGET_DIR}") - - # Mark that we need to pop the root search path changes after we have - # found all cuda libraries so that searches for our cross-compilation - # libraries work when another cuda sdk is in CMAKE_PREFIX_PATH or - # PATh - set(_CUDAToolkit_Pop_ROOT_PATH True) - endif() + foreach(CUDAToolkit_TARGET_NAME IN LISTS CUDAToolkit_TARGET_NAMES) + if(EXISTS "${CUDAToolkit_ROOT_DIR}/targets/${CUDAToolkit_TARGET_NAME}") + set(CUDAToolkit_TARGET_DIR "${CUDAToolkit_ROOT_DIR}/targets/${CUDAToolkit_TARGET_NAME}") + # add known CUDA target root path to the set of directories we search for programs, libraries and headers + list(PREPEND CMAKE_FIND_ROOT_PATH "${CUDAToolkit_TARGET_DIR}") + + # Mark that we need to pop the root search path changes after we have + # found all cuda libraries so that searches for our cross-compilation + # libraries work when another cuda sdk is in CMAKE_PREFIX_PATH or + # PATh + set(_CUDAToolkit_Pop_ROOT_PATH True) + break() + endif() + endforeach() endif() # If not already set we can simply use the toolkit root or it's a scattered installation. |