Commit Graph
86 Commits
Author SHA1 Message Date
Stanislav Angelovič d177d2e365 chore: reorder some API functions (#404)
In sdbus-c++ v1, new virtual functions (e.g. overloads of existing virtual functions) were always placed at the end of the class to keep backwards ABI compatibility. Now, with v2, these functions are reordered and functions forming a logical group are together.
2024-04-24 20:20:29 +02:00
Stanislav Angelovič c205178fc0 chore: rename COMPONENTs in CMake (#402) 2024-04-24 20:20:29 +02:00
Stanislav Angelovič 0074c79e7f refactor: rename and re-organize CMake options (#401)
This improves usability of sdbus-c++ in downstream CMake projects. CMake options now have `SDBUSCPP_` prefix so potential conflicts with downstream options/variables are minimized. Also, all configurable options and variables are placed in a single place in the root CMake file.
2024-04-24 20:20:29 +02:00
Stanislav Angelovič bdf313bc60 refactor: improve Object vtable registration (#388)
This improves the D-Bus object API registration/unregistration by making it more flexible, more dynamic, closer to sd-bus API design but still on high abstraction level, and -- most importantly -- less error-prone since no `finishRegistration()` call is needed anymore.
2024-04-24 20:20:29 +02:00
Marcel Hellwig c6afa26541 fix: update cmake version for library to 2.0.0
This will also install the library as `libsdbus-c++.so.2.0.0`, which
represents the actual version of this library
2024-04-24 20:20:29 +02:00
Stanislav Angelovič 0bfda9ab92 chore: require cmake v3.14 and use FetchContent_MakeAvailable 2024-04-24 20:20:29 +02:00
Stanislav Angelovic 3e20fc639e refactor: simplify async D-Bus connection handling 2024-04-24 20:20:29 +02:00
Stanislav Angelovič 7450515d0b chore: release version v1.6.0 2024-04-24 20:04:34 +02:00
Stanislav Angelovič 30d9f1d462 chore: release v1.5.0 2024-02-26 08:29:35 +01:00
Stanislav Angelovič 934d51fa8a chore: add INSTALL_TESTS CMake option (#382)
* Change default test installation path to tests/sdbus-c++ , while also respecting CMAKE_INSTALL_PREFIX
* Introduce INSTALL_TESTS CMake option, so BUILD_TESTS is now split into BUILD_TESTS just for building and INSTALL_TESTS for installing the test binaries

Per discussion in #358 (comment), the change in the default settings is fine a for a minor release.
2023-11-23 21:05:44 +01:00
FuchtelJockelandStanislav Angelovič fb9e4ae371 fix: correctly add libsystemd dependency to pkgconfig (#378)
* fix: correctly add libsystemd dependency to pkgconfig

* refactor: solve sd-bus dependencies uniformly

---------

Co-authored-by: Stanislav Angelovič <stanislav.angelovic@protonmail.com>
2023-11-20 14:41:59 +01:00
Stanislav Angelovič f420b216aa docs: update documentation 2023-10-16 15:30:23 +02:00
Stanislav Angelovič b482cd6d08 chore: version 1.4.0 2023-10-10 19:26:21 +02:00
Stanislav Angelovič c437b4d508 fix: honor CMAKE_POSITION_INDEPENDENT_CODE when building (#361) 2023-09-25 08:53:24 +02:00
Jan Beich 1e2d13a04a feat: add FreeBSD support (#358)
* chore: don't use systemd headers with elogind

In file included from src/VTableUtils.c:27:
src/VTableUtils.h:30:10: fatal error: 'systemd/sd-bus.h' file not found
 #include <systemd/sd-bus.h>
          ^~~~~~~~~~~~~~~~~~

* chore: add basu support

Similar to elogind but also supported on non-Linux.

* chore(tests): permit /var/lib/machine-id on non-systemd

https://github.com/elogind/elogind/commit/84fdc0fc61c1
https://git.sr.ht/~emersion/basu/commit/8324e6729231

* chore(ci): add simple freebsd job

Mainly to cover libc++ and basu.

* chore(ci): explicitly pass CMAKE_INSTALL_PREFIX

Some sdbus-cpp tests require configuring system bus. However, Linux
testing relies on writing outside of prefix in order to affect current
system bus instance instead of launching a dedicated one.

* chore(tests): respect CMAKE_INSTALL_PREFIX for system bus config

DBus isn't part of base system on BSDs, so may not use /etc for configs.
Also, testing installation failed as non-root:

$ cmake -DBUILD_TESTS=1 -DCMAKE_INSTALL_PREFIX=/tmp/sdbus-cpp_prefix -DTESTS_INSTALL_PATH=/tmp/sdbus-cpp_prefix/tests
$ cmake --build .
$ cmake --install .
[...]
CMake Error at tests/cmake_install.cmake:105 (file):
  file cannot create directory: /etc/dbus-1/system.d.  Maybe need
  administrative privileges.

* chore(tests): temporarily skip 1 test on FreeBSD to keep CI happy

* chore(ci): run tests in freebsd job
2023-09-18 11:35:23 +02:00
Stanislav Angelovič 0eda855745 chore: version 1.3.0 2023-08-20 11:45:44 +02:00
ApteryksandSven Eden 8113bf88ad chore(cmake): add support for libelogind (#352)
* CMakeLists.txt: Fallback to elogind when libsystemd could not be
found.  Set LIBSYSTEMD variable.
* pkgconfig/sdbus-c++.pc.in (Description): Parameterize with above
LIBSYSTEMD variable.

Co-authored-by: Sven Eden <sven.eden@prydeworx.com>
2023-08-18 12:08:37 +02:00
Stanislav Angelovič f332f46087 fix: use correct runtime component in CMake file 2023-01-17 09:58:21 +01:00
Stanislav Angelovic 7a09e9bcc8 chore: install namelink to dev component 2023-01-03 15:24:17 +01:00
James Le Cuirot 35bffd0f25 build: don't include libsystemd as shared pkg-config dep when statically linked (#283)
This works whether `BUILD_LIBSYSTEMD` is `ON` or the separate build of
libsystemd picked up by pkg-config is static. The Gentoo Linux package
requires the latter.

This change also handles `BUILD_SHARED_LIBS` being `OFF`. In this case,
the libsystemd dependency does need to be included, even though it is
static.

CMake does not allow you to build shared and static libraries
simultaneously (with a single `add_library` call), but this change
declares the libsystemd dependency as `Requires.private` rather than
omitting it entirely. This is in case someone builds and installs both a
static and shared build and then calls `pkg-config --static sdbus-c++`.
The static build needs to be installed first so that the pkg-config
file from the shared build takes precedence.
2022-09-03 22:54:06 +02:00
Stanislav Angelovic 751c1addc4 chore: version 1.2.0 2022-08-09 09:50:33 +02:00
Stanislav Angelovič b7a9c63ff0 refactor: add validity checks for names and paths (#242) 2022-02-11 21:53:37 +01:00
Stanislav Angelovic bca8e81037 build: version 1.1.0 2021-12-22 13:17:31 +01:00
Stanislav Angelovic 0b8f2d9752 fix: use correct path to README file for CPack 2021-12-15 12:46:05 +01:00
Stanislav Angelovic ef4d9bcba2 chore: add note on libsystemd-dev when libsystemd pkgconfig file is not found 2021-12-14 21:35:11 +01:00
Urs Ritzmann 125cb1616c version 1.0.0 2021-10-25 09:02:37 +02:00
Urs Ritzmann f05f63cd48 cpack: remove test component
If -DBUILD_TESTS=ON, then creating debian packages fails
because dpkg-shlibdeps obiously can't find the sdbus-c++ dependency
for the tests package.

We could disable CPACK_DEBIAN_PACKAGE_SHLIBDEPS for the tests package.
Nevertheless I don't think we want a tests package at all.
2021-10-25 09:00:30 +02:00
Urs Ritzmann a5ecbbfcec add examples for the ObjectManager API 2021-10-18 11:58:07 +02:00
Rolf Lussi a341754533 add dependency to libsytemd-dev to sdbus-c++-dev package 2021-09-23 20:18:14 +02:00
Rolf Lussi 9cb8b89a01 add cpack to build debian packages, split the packages by components 2021-09-23 20:18:14 +02:00
riuriuriu e1008dd8cf reformat CMake linking 2021-04-13 11:02:20 +02:00
Luca Boccassi fc9f770512 Find and link against pthread
Building on SUSE fails, as std::thread usage requires linking
against pthread:

/usr/bin/c++ -fPIC -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -DNDEBUG -O3 -DNDEBUG -flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now -shared -Wl,-soname,libsdbus-c++.so.0 -o libsdbus-c++.so.0.8.3 CMakeFiles/sdbus-c++-objlib.dir/src/Connection.cpp.o CMakeFiles/sdbus-c++-objlib.dir/src/Error.cpp.o CMakeFiles/sdbus-c++-objlib.dir/src/Message.cpp.o CMakeFiles/sdbus-c++-objlib.dir/src/Object.cpp.o CMakeFiles/sdbus-c++-objlib.dir/src/Proxy.cpp.o CMakeFiles/sdbus-c++-objlib.dir/src/Types.cpp.o CMakeFiles/sdbus-c++-objlib.dir/src/Flags.cpp.o CMakeFiles/sdbus-c++-objlib.dir/src/VTableUtils.c.o CMakeFiles/sdbus-c++-objlib.dir/src/SdBus.cpp.o  /usr/lib64/libsystemd.so
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /tmp/libsdbus-c++.so.0.8.3.uWoUml.ltrans0.ltrans.o: in function `sdbus::internal::Connection::enterEventLoopAsync()':
<artificial>:(.text+0x2bb): undefined reference to `pthread_create'
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /tmp/libsdbus-c++.so.0.8.3.uWoUml.ltrans0.ltrans.o: in function `non-virtual thunk to sdbus::internal::Connection::enterEventLoopAsync()':
<artificial>:(.text+0x37a): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
2021-04-13 10:56:43 +02:00
Stanislav Angelovic a649a0225e style: fix indentation in CMakeLists.txt 2021-03-12 14:01:02 +01:00
Yonggang Luo cfb9956de6 Fixes for floating point systemd version such as 243.4 (#128)
```
~/package $ pkg-config --modversion libsystemd
243.4
~/package $
```
Split it to the list and use the first one
2021-03-12 13:26:21 +01:00
Stanislav Angelovic 6e8e5aadb6 Bump up to v0.8.3 2020-09-11 22:29:15 +02:00
Stanislav Angelovic 250aa2bbe3 Add additional messages to CMake build for optional parts 2020-07-21 12:12:14 +02:00
Stanislav Angelovic 175c43ec53 Bump revision up to v0.8.2 2020-06-17 15:29:46 +02:00
Stanislav Angelovič a23aadbe5e Fix required CMake version to v3.13
Fixes #86
2020-02-14 14:31:14 +01:00
sangelovic dee6adce02 Bump revision up to v0.8.1 2020-02-02 02:31:39 +01:00
sangelovic 3e68fee4cd Switch to more modern CMake 2020-02-02 02:29:32 +01:00
sangelovic d591b69f92 Bump revision up to 0.8.0 2020-02-01 13:56:13 +01:00
sangelovic 10977c6137 Bump revision up to 0.7.8 2020-01-25 23:38:54 +01:00
sangelovic 68b5eac9e9 Bump revision up to 0.7.7 2020-01-19 18:59:36 +01:00
sangelovic 5121d46eed Bump revision up to 0.7.6 2020-01-05 22:49:26 +01:00
sangelovic cc495811f9 Bump revision up to 0.7.5 2019-11-10 17:43:14 +01:00
sangelovic d50a15b2a2 Move C++17 uncaught_exceptions to public API 2019-11-10 17:31:58 +01:00
sangelovic 3a76e9c120 Bump revision up to 0.7.4 2019-11-03 20:40:13 +01:00
lubo-svk c139110112 Add support for custom timeout value for D-Bus method calls (#72) 2019-11-03 13:54:13 +01:00
sangelovic e7155c5506 Bump revision up to 0.7.3 2019-10-13 15:39:32 +02:00
Stanislav Angelovic 750dab3927 Bump revision up to 0.7.2 2019-07-08 10:01:11 +02:00