From 28706fa33953b487b78b8736ce9e52edaaeb4a52 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Wed, 27 May 2015 14:58:22 -0300 Subject: [PATCH 2/2] QNX: Link against libsocket QNX provides socket functions inside libsocket.so. Failing to link against this library will not only bring about unresolved symbols, but symbol checks will also fail. --- cmake/CMakeLists.txt | 5 +++++ cmake/bus/CMakeLists.txt | 9 +++++---- cmake/dbus/CMakeLists.txt | 4 ++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 20a8334..c2c41ed 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -105,6 +105,11 @@ if (CYGWIN) set (WIN32) endif (CYGWIN) +if (CMAKE_SYSTEM_NAME STREQUAL "QNX") + set(QNX_LIBRARIES socket) + set(CMAKE_REQUIRED_LIBRARIES ${QNX_LIBRARIES}) +endif() + # search for required packages if (WIN32) # include local header first to avoid using old installed header diff --git a/cmake/bus/CMakeLists.txt b/cmake/bus/CMakeLists.txt index 40f6690..8b6c0c0 100644 --- a/cmake/bus/CMakeLists.txt +++ b/cmake/bus/CMakeLists.txt @@ -86,7 +86,8 @@ include_directories( ) add_executable(dbus-daemon ${BUS_SOURCES} ${BUS_DIR}/main.c) -target_link_libraries(dbus-daemon ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY}) +target_link_libraries(dbus-daemon ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY} ${QNX_LIBRARIES}) + set_target_properties(dbus-daemon PROPERTIES OUTPUT_NAME ${DBUS_DAEMON_NAME}) set_target_properties(dbus-daemon PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS}) @@ -160,11 +161,11 @@ set(LAUNCH_HELPER_SOURCES ${XML_SOURCES} if(NOT WIN32) # TODO PENDING(kdab) fix build on windows (activation-helper.c) add_executable(dbus-daemon-launch-helper ${LAUNCH_HELPER_SOURCES} ${BUS_DIR}/activation-helper-bin.c ) - target_link_libraries(dbus-daemon-launch-helper ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY} ) - + target_link_libraries(dbus-daemon-launch-helper ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY} ${QNX_LIBRARIES} ) + add_executable(dbus-daemon-launch-helper-test ${LAUNCH_HELPER_SOURCES} ${BUS_DIR}/activation-helper-bin.c) set_target_properties(dbus-daemon-launch-helper-test PROPERTIES COMPILE_FLAGS "-DACTIVATION_LAUNCHER_TEST") - target_link_libraries(dbus-daemon-launch-helper-test ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY} ) + target_link_libraries(dbus-daemon-launch-helper-test ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY} ${QNX_LIBRARIES} ) set (SOURCES ${LAUNCH_HELPER_SOURCES} ${BUS_DIR}/test-launch-helper.c) add_test_executable(test-bus-launch-helper "${SOURCES}" ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY}) diff --git a/cmake/dbus/CMakeLists.txt b/cmake/dbus/CMakeLists.txt index 482966b..788daf3 100644 --- a/cmake/dbus/CMakeLists.txt +++ b/cmake/dbus/CMakeLists.txt @@ -259,6 +259,10 @@ add_library(dbus-1 SHARED ${libdbus_SOURCES} ${libdbus_HEADERS} ) + + +target_link_libraries(dbus-1 ${QNX_LIBRARIES}) + if(DEFINED DBUS_LIBRARY_REVISION) math(EXPR DBUS_LIBRARY_MAJOR "${DBUS_LIBRARY_CURRENT} - ${DBUS_LIBRARY_AGE}") endif() -- 2.4.1