mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2025-12-29 19:30:12 +01:00
Make the windows binaries and build match the linux one with cmake buildsystem.
This is performed by including the files from the client lib in the internal one and by removing the linking to dbus-1 for targets using the internal library.
This commit is contained in:
parent
1fb6d3faf6
commit
2154acb349
5 changed files with 29 additions and 6 deletions
|
|
@ -495,7 +495,13 @@ if (DBUS_BUILD_TESTS)
|
|||
endif (DBUS_BUILD_TESTS)
|
||||
|
||||
set(DBUS_LIBRARIES dbus-1)
|
||||
set(DBUS_INTERNAL_LIBRARIES dbus-1 dbus-internal)
|
||||
set(DBUS_INTERNAL_LIBRARIES dbus-internal)
|
||||
|
||||
# settings for building and using static internal lib
|
||||
# important note: DBUS_INTERNAL_xxxxx_DEFINITIONS must *not* be set when building dbus-1 library
|
||||
set (DBUS_INTERNAL_ADD_LIBRARY_OPTIONS STATIC)
|
||||
set (DBUS_INTERNAL_LIBRARY_DEFINITIONS "-DDBUS_STATIC_BUILD")
|
||||
set (DBUS_INTERNAL_CLIENT_DEFINITIONS "-DDBUS_STATIC_BUILD")
|
||||
|
||||
########### subdirs ###############
|
||||
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ include_directories(${XML_INCLUDE_DIR})
|
|||
add_executable(dbus-daemon ${BUS_SOURCES} ${BUS_DIR}/main.c)
|
||||
target_link_libraries(dbus-daemon ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
|
||||
set_target_properties(dbus-daemon PROPERTIES OUTPUT_NAME ${DBUS_DAEMON_NAME})
|
||||
set_target_properties(dbus-daemon PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
|
||||
|
||||
install_targets(/bin dbus-daemon)
|
||||
install_files(/etc FILES ${config_DATA})
|
||||
|
|
@ -94,12 +95,14 @@ if (DBUS_SERVICE)
|
|||
|
||||
add_executable(dbus-service ${dbus_service_SOURCES} )
|
||||
target_link_libraries(dbus-service ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
|
||||
set_target_properties(dbus-service PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
|
||||
install_targets(/bin dbus-service )
|
||||
endif (DBUS_SERVICE)
|
||||
|
||||
if (DBUS_BUILD_TESTS)
|
||||
add_executable(bus-test ${BUS_SOURCES} ${BUS_DIR}/test-main.c)
|
||||
target_link_libraries(bus-test ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
|
||||
set_target_properties(bus-test PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
|
||||
add_test(bus-test ${EXECUTABLE_OUTPUT_PATH}/bus-test ${CMAKE_BINARY_DIR}/test/data)
|
||||
endif (DBUS_BUILD_TESTS)
|
||||
|
||||
|
|
|
|||
|
|
@ -264,16 +264,26 @@ install_files(/include/dbus FILES ${dbusinclude_HEADERS})
|
|||
|
||||
### Internal library, used for the daemon, tools and tests, compiled statically.
|
||||
|
||||
add_library(dbus-internal STATIC
|
||||
add_library(dbus-internal ${DBUS_INTERNAL_ADD_LIBRARY_OPTIONS}
|
||||
${DBUS_LIB_SOURCES}
|
||||
${DBUS_LIB_HEADERS}
|
||||
${DBUS_SHARED_SOURCES}
|
||||
${DBUS_SHARED_HEADERS}
|
||||
${DBUS_UTIL_SOURCES}
|
||||
${DBUS_UTIL_HEADERS})
|
||||
target_link_libraries(dbus-internal dbus-1)
|
||||
${DBUS_UTIL_HEADERS}
|
||||
)
|
||||
target_link_libraries(dbus-internal)
|
||||
set_target_properties(dbus-internal PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_LIBRARY_DEFINITIONS})
|
||||
if(WIN32)
|
||||
target_link_libraries(dbus-internal ws2_32 advapi32 netapi32)
|
||||
endif(WIN32)
|
||||
|
||||
if (DBUS_BUILD_TESTS)
|
||||
set (TESTS_ENVIRONMENT "DBUS_TEST_DATA=${CMAKE_SOURCE_DIR}/test/data DBUS_TEST_HOMEDIR=${CMAKE_BUILD_DIR}/dbus")
|
||||
ADD_EXECUTABLE(dbus-test ${CMAKE_SOURCE_DIR}/../dbus/dbus-test-main.c)
|
||||
target_link_libraries(dbus-test dbus-1 dbus-internal)
|
||||
target_link_libraries(dbus-test ${DBUS_INTERNAL_LIBRARIES})
|
||||
add_test(dbus-test ${EXECUTABLE_OUTPUT_PATH}/dbus-test ${CMAKE_SOURCE_DIR}/../test/data)
|
||||
set_target_properties(dbus-test PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
|
||||
ENDIF (DBUS_BUILD_TESTS)
|
||||
|
||||
if (UNIX)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
project(test)
|
||||
|
||||
add_definitions(${DBUS_INTERNAL_CLIENT_DEFINITIONS})
|
||||
|
||||
add_subdirectory( name-test )
|
||||
|
||||
set (test-service_SOURCES
|
||||
|
|
|
|||
|
|
@ -158,7 +158,9 @@
|
|||
*/
|
||||
|
||||
#if defined(_WIN32)
|
||||
# if defined(dbus_1_EXPORTS)
|
||||
# if defined(DBUS_STATIC_BUILD)
|
||||
# define DBUS_EXPORT
|
||||
# elif defined(dbus_1_EXPORTS)
|
||||
# define DBUS_EXPORT __declspec(dllexport)
|
||||
# else
|
||||
# define DBUS_EXPORT __declspec(dllimport)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue