From 46371132b3d79d2a4c86ee2a99b7a0fed4367750 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Mon, 11 Nov 2019 11:49:52 -0500 Subject: 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. --- Modules/FindCUDA.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Modules/FindCUDA.cmake') diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 85d705c8d6..2a3e1317a8 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() -- cgit v1.2.1