Skip to content

Commit

Permalink
Add pthreads to link libraries, not link flags
Browse files Browse the repository at this point in the history
This fixes linking errors with --as-needed like:
ld: libobjc.so.4.6: undefined reference to `pthread_mutexattr_destroy'

Fixes #180
  • Loading branch information
voyageur authored and davidchisnall committed Apr 2, 2021
1 parent 2d976b6 commit 2deec33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ endif()
# threading implementation (we do for everything except thread-local storage)
set(CMAKE_THREAD_PREFER_PTHREAD)
include(FindThreads)
set(objc_LINK_FLAGS "${objc_LINK_FLAGS} ${CMAKE_THREAD_LIBS_INIT}")
target_link_libraries(objc Threads::Threads)



Expand Down

0 comments on commit 2deec33

Please sign in to comment.