Add pthreads to link libraries, not link flags

This fixes linking errors with --as-needed like:
ld: libobjc.so.4.6: undefined reference to `pthread_mutexattr_destroy'

Fixes #180
main
Bernard Cafarelli 5 years ago committed by David Chisnall
parent 2d976b61e2
commit 2deec335f6

@ -353,7 +353,7 @@ endif()
# threading implementation (we do for everything except thread-local storage) # threading implementation (we do for everything except thread-local storage)
set(CMAKE_THREAD_PREFER_PTHREAD) set(CMAKE_THREAD_PREFER_PTHREAD)
include(FindThreads) include(FindThreads)
set(objc_LINK_FLAGS "${objc_LINK_FLAGS} ${CMAKE_THREAD_LIBS_INIT}") target_link_libraries(objc Threads::Threads)

Loading…
Cancel
Save