summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2018-10-22 09:54:54 -0400
committerBrad King <brad.king@kitware.com>2018-10-24 10:15:41 -0400
commit83c13ca44f661ba22acf4abe63d84fd5651b4dbc (patch)
tree737c66d6a5b6b2769899e2d154612e7002ad326c /Modules
parentcf92fd9ae9a50491e0e5a24d127b82dbda211a25 (diff)
downloadcmake-83c13ca44f661ba22acf4abe63d84fd5651b4dbc.tar.gz
FindThreads: Pass -pthread to CUDA compiler through -Xcompiler
Fixes: #18008
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindThreads.cmake4
1 files changed, 3 insertions, 1 deletions
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 "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler -pthread>"
+ "$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:-pthread>")
endif()
if(CMAKE_THREAD_LIBS_INIT)