summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2018-10-22 13:54:54 (GMT)
committerBrad King <brad.king@kitware.com>2018-10-24 14:15:41 (GMT)
commit83c13ca44f661ba22acf4abe63d84fd5651b4dbc (patch)
tree737c66d6a5b6b2769899e2d154612e7002ad326c
parentcf92fd9ae9a50491e0e5a24d127b82dbda211a25 (diff)
downloadCMake-83c13ca44f661ba22acf4abe63d84fd5651b4dbc.zip
CMake-83c13ca44f661ba22acf4abe63d84fd5651b4dbc.tar.gz
CMake-83c13ca44f661ba22acf4abe63d84fd5651b4dbc.tar.bz2
FindThreads: Pass -pthread to CUDA compiler through -Xcompiler
Fixes: #18008
-rw-r--r--Modules/FindThreads.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake
index a0148dd..75e83ea 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)