mirror of
https://github.com/openharmony/third_party_cmake.git
synced 2026-07-21 08:15:27 -04:00
FindThreads: Pass -pthread to CUDA compiler through -Xcompiler
Fixes: #18008
This commit is contained in:
committed by
Brad King
parent
5fdf26019c
commit
6d7b9e89d0
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user