diff options
author | janbernloehr <jan@bernloehrs.de> | 2020-10-30 14:01:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-11-02 14:39:36 (GMT) |
commit | bcdd486bf761244a6921fbcb382a3be99c40107e (patch) | |
tree | a2cb6ac20040d87db1f81447958e67cd1337427a /Modules/FindCUDA.cmake | |
parent | f506cc6bb2d16b8876bd6e38741e80fc88482d1f (diff) | |
download | CMake-bcdd486bf761244a6921fbcb382a3be99c40107e.zip CMake-bcdd486bf761244a6921fbcb382a3be99c40107e.tar.gz CMake-bcdd486bf761244a6921fbcb382a3be99c40107e.tar.bz2 |
CUDA: Enable support on QNX
This fixes the following two issues with the CUDA support on QNX:
* cuda target name is not derived correctly (should be `aarch64-qnx`).
* linking `cudart` must not be linked against `rt`, `dl`, `pthread`.
This enables to use cmake's native cuda support on QNX.
Fixes: #21381
Diffstat (limited to 'Modules/FindCUDA.cmake')
-rw-r--r-- | Modules/FindCUDA.cmake | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index a93d4fd..f04f571 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -732,6 +732,8 @@ if(CMAKE_CROSSCOMPILING) # Support for aarch64 cross compilation if (ANDROID_ARCH_NAME STREQUAL "arm64") set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux-androideabi") + elseif (CMAKE_SYSTEM_NAME STREQUAL "QNX") + set(CUDA_TOOLKIT_TARGET_NAME "aarch64-qnx") else() set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux") endif (ANDROID_ARCH_NAME STREQUAL "arm64") @@ -902,7 +904,7 @@ if(CUDA_USE_STATIC_CUDA_RUNTIME) find_package(Threads REQUIRED) set(CMAKE_C_FLAGS ${_cuda_cmake_c_flags}) - if(NOT APPLE) + if(NOT APPLE AND NOT (CMAKE_SYSTEM_NAME STREQUAL "QNX")) #On Linux, you must link against librt when using the static cuda runtime. find_library(CUDA_rt_LIBRARY rt) if (NOT CUDA_rt_LIBRARY) |