summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-02-25 13:58:09 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-02-25 13:58:17 (GMT)
commit8a7c485d3ff6a08033249ace680e2d5176c28a8c (patch)
tree2e3a5987858773290d4a4145cf8ada8045168cff
parent3a6481670fbe0ce20d05ef65f5632ca874f41978 (diff)
parentb9d67447c35681ccf272ec1744cb3208aa2745ba (diff)
downloadCMake-8a7c485d3ff6a08033249ace680e2d5176c28a8c.zip
CMake-8a7c485d3ff6a08033249ace680e2d5176c28a8c.tar.gz
CMake-8a7c485d3ff6a08033249ace680e2d5176c28a8c.tar.bz2
Merge topic 'FindCUDA-no-threads-target' into release-3.17
b9d67447c3 FindCUDA: Only depend on Threads::Threads on platforms that need it Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4377
-rw-r--r--Modules/FindCUDA.cmake6
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 0e2f551..e1af2d6 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -929,7 +929,11 @@ set(CUDA_LIBRARIES)
if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY)
list(APPEND CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY})
elseif(CUDA_USE_STATIC_CUDA_RUNTIME AND CUDA_cudart_static_LIBRARY)
- list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY} Threads::Threads ${CMAKE_DL_LIBS})
+ list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY})
+ if (TARGET Threads::Threads)
+ list(APPEND CUDA_LIBRARIES Threads::Threads)
+ endif()
+ list(APPEND CUDA_LIBRARIES ${CMAKE_DL_LIBS})
if (CUDA_rt_LIBRARY)
list(APPEND CUDA_LIBRARIES ${CUDA_rt_LIBRARY})
endif()