Fix building with CMake for a Unix platform where functions like recv() are in a...
authorRalf Habacker <ralf.habacker@freenet.de>
Wed, 17 Aug 2016 16:43:41 +0000 (18:43 +0200)
committerRalf Habacker <ralf.habacker@freenet.de>
Thu, 18 Aug 2016 12:59:41 +0000 (14:59 +0200)
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=94096
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
cmake/dbus/CMakeLists.txt

index 452a9e3..86c4058 100644 (file)
@@ -257,6 +257,9 @@ endif(MSVC_IDE)
 # for clock_getres() on e.g. GNU/Linux (but not Android)
 find_library(LIBRT rt)
 
+# for socket() on QNX
+find_library(LIBSOCKET socket)
+
 ### Client library
 add_library(dbus-1 SHARED
                        ${libdbus_SOURCES}
@@ -288,6 +291,9 @@ else(WIN32)
     if(LIBRT)
         target_link_libraries(dbus-1 ${LIBRT})
     endif()
+    if(LIBSOCKET)
+        target_link_libraries(dbus-1 ${LIBSOCKET})
+    endif()
 endif(WIN32)
 
 # Assume that Linux has -Wl,--version-script and other platforms do not
@@ -318,6 +324,9 @@ else(WIN32)
     if(LIBRT)
         target_link_libraries(dbus-internal ${LIBRT})
     endif()
+    if(LIBSOCKET)
+        target_link_libraries(dbus-internal ${LIBSOCKET})
+    endif()
 endif(WIN32)
 
 if (DBUS_ENABLE_EMBEDDED_TESTS)