diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2019-11-11 16:49:52 (GMT) |
---|---|---|
committer | Robert Maynard <robert.maynard@kitware.com> | 2019-11-11 16:52:02 (GMT) |
commit | 46371132b3d79d2a4c86ee2a99b7a0fed4367750 (patch) | |
tree | 34340d888e8fc1dce69feb66faa9dd9260e90285 /Modules/FindCUDA.cmake | |
parent | 74569996e8fe798386cca2d4241acea0644f6275 (diff) | |
download | CMake-46371132b3d79d2a4c86ee2a99b7a0fed4367750.zip CMake-46371132b3d79d2a4c86ee2a99b7a0fed4367750.tar.gz CMake-46371132b3d79d2a4c86ee2a99b7a0fed4367750.tar.bz2 |
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.
Diffstat (limited to 'Modules/FindCUDA.cmake')
-rw-r--r-- | Modules/FindCUDA.cmake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 85d705c..2a3e131 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -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() |