mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 10:50:16 -06:00
FindCUDA: CUDA_LIBRARIES doesn't contain raw -pthread
If a person tried to pass `CUDA_LIBRARIES` to nvcc compiler it could fail as it might have `-pthread` which nvcc doesn't support. Instead we now use the `Threads::Threads` so that nvcc gets the correct `-Xcompiler -pthread` flag.
This commit is contained in:
@@ -924,7 +924,7 @@ 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} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
|
||||
list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY} Threads::Threads ${CMAKE_DL_LIBS})
|
||||
if (CUDA_rt_LIBRARY)
|
||||
list(APPEND CUDA_LIBRARIES ${CUDA_rt_LIBRARY})
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user