From 83c13ca44f661ba22acf4abe63d84fd5651b4dbc Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Mon, 22 Oct 2018 09:54:54 -0400 Subject: FindThreads: Pass -pthread to CUDA compiler through -Xcompiler Fixes: #18008 --- Modules/FindThreads.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Modules/FindThreads.cmake') diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake index a0148dd900..75e83ea4a0 100644 --- a/Modules/FindThreads.cmake +++ b/Modules/FindThreads.cmake @@ -208,7 +208,9 @@ if(THREADS_FOUND AND NOT TARGET Threads::Threads) add_library(Threads::Threads INTERFACE IMPORTED) if(THREADS_HAVE_PTHREAD_ARG) - set_property(TARGET Threads::Threads PROPERTY INTERFACE_COMPILE_OPTIONS "-pthread") + set_property(TARGET Threads::Threads + PROPERTY INTERFACE_COMPILE_OPTIONS "$<$:SHELL:-Xcompiler -pthread>" + "$<$>:-pthread>") endif() if(CMAKE_THREAD_LIBS_INIT) -- cgit v1.2.1