From 26b04515a974ec1aca9238e730a7e9c2c902556d Mon Sep 17 00:00:00 2001 From: thebeing Date: Fri, 8 Mar 2013 13:22:08 +0000 Subject: [PATCH] Link libdispatch if it is available, since the toydispatch stuff will pull it in. --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 00cf87e..ca59b22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -203,6 +203,8 @@ else (CXX_RUNTIME) list(APPEND INSTALL_TARGETS objcxx) endif (CXX_RUNTIME) + + # Currently, we actually need pthreads, but we should use the platform's native # threading implementation (we do for everything except thread-local storage) set(CMAKE_THREAD_PREFER_PTHREAD) @@ -239,6 +241,12 @@ if (LIBGC) target_link_libraries(objc ${LIBGC}) endif () +# Link libdispatch if available (we'll miss symbols for toydispatch otherwise) +find_library(LIBDISPATCH dispatch) +if (LIBDISPATCH) + target_link_libraries(objc ${LIBDISPATCH}) +endif () + # # Installation #