mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-09 15:20:56 -06:00
FindCUDA: Only depend on Threads::Threads on platforms that need it
In commit 46371132b3 (FindCUDA: CUDA_LIBRARIES doesn't contain raw
`-pthread`, 2019-11-11, v3.17.0-rc1~455^2) we introduced use of the
`Threads::Threads` target, but we do not `find_package(Threads)` on all
platforms. Use the target only if it exists.
This commit is contained in:
committed by
Brad King
parent
125f0451a9
commit
b9d67447c3
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user