Commit 46371132 authored by Robert Maynard's avatar Robert Maynard

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.
parent 74569996
Pipeline #150912 passed with stage
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment