summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2012-03-12 15:40:30 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2012-06-15 14:42:19 +0100
commitb47f4c22ee7adf57e1a5377d5f9cbdbe6423a111 (patch)
tree9c2dec4be4e043b35b6adb4a9418143749f54a94
parentefddba53da6b76478064f43d8235de12151f33ad (diff)
downloaddbus-b47f4c22ee7adf57e1a5377d5f9cbdbe6423a111.tar.gz
dbus-b47f4c22ee7adf57e1a5377d5f9cbdbe6423a111.tar.bz2
dbus-b47f4c22ee7adf57e1a5377d5f9cbdbe6423a111.zip
On Unix, link libdbus to a platform-specific threading library
On Linux, this is libpthread; on other Unixes, in principle it might be called libpthreads or libthreads or something. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=47237 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
-rw-r--r--cmake/CMakeLists.txt2
-rw-r--r--cmake/dbus/CMakeLists.txt4
2 files changed, 6 insertions, 0 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index ba44d575..000acda2 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -83,6 +83,8 @@ option (DBUS_USE_EXPAT "Use expat (== ON) or libxml2 (==OFF)" ON)
if(NOT WIN32)
option (DBUS_ENABLE_ABSTRACT_SOCKETS "enable support for abstract sockets" ON)
+ set (CMAKE_THREAD_PREFER_PTHREAD ON)
+ include (FindThreads)
endif(NOT WIN32)
#AC_ARG_ENABLE(asserts, AS_HELP_STRING([--enable-asserts],[include assertion checks]),enable_asserts=$enableval,enable_asserts=$USE_MAINTAINER_MODE)
diff --git a/cmake/dbus/CMakeLists.txt b/cmake/dbus/CMakeLists.txt
index 13d6f87a..d09e63df 100644
--- a/cmake/dbus/CMakeLists.txt
+++ b/cmake/dbus/CMakeLists.txt
@@ -266,6 +266,8 @@ if(WIN32)
else(WINCE)
target_link_libraries(dbus-1 ws2_32 advapi32 netapi32)
endif(WINCE)
+else(WIN32)
+ target_link_libraries(dbus-1 ${CMAKE_THREAD_LIBS_INIT})
endif(WIN32)
install_targets(/lib dbus-1 )
@@ -289,6 +291,8 @@ if(WIN32)
else(WINCE)
target_link_libraries(dbus-internal ws2_32 advapi32 netapi32)
endif(WINCE)
+else(WIN32)
+ target_link_libraries(dbus-internal ${CMAKE_THREAD_LIBS_INIT})
endif(WIN32)
if (DBUS_BUILD_TESTS)