wisun-br-linux icon indicating copy to clipboard operation
wisun-br-linux copied to clipboard

Allowing compiling without DBUS.

Open skilau opened this issue 10 months ago • 2 comments

There is a minor bug in CMakeLists.txt that always brings in common/dbus.c, even though later in the CMakeLists.txt file it is properly bounded by the check of "if(LIBSYSTEMD_FOUND)" (See line ~373 in CMakeLists.txt for it)

Because the line always brings in common/dbus.c, building without dbus isn't possible. Removing the 1 line from the CMakeLists.txt fixes this issue.

skilau avatar Feb 14 '25 04:02 skilau

Hello, and thank you for pointing this out. Can you add back common/dbus.c in the D-Bus conditional sources?

MathisMARION avatar Feb 14 '25 08:02 MathisMARION

Sorry about that. I actually thought that the line down in ~373 would bring it in. I should have tested it first. I updated the PR to do: $<$BOOL:${LIBSYSTEMD_FOUND}:common/dbus.c>

Instead, which does fix the compilation for both non-DBUS and DBUS builds.

skilau avatar Feb 14 '25 14:02 skilau

NOTE: Added a second minor patch on this PR as well.

I had to tag "wsbrd_dbus_vtable" as unused, or otherwise we get this error:

`[22/135] Building C object CMakeFiles/libwsbrd.dir/app_wsbrd/app/wsbr_mac.c.o In file included from app_wsbrd/app/wsbr_mac.c:48:

app_wsbrd/app/dbus.h:24:36: warning: ‘wsbrd_dbus_vtable’ defined but not used [-Wunused-variable] 24 | static const struct sd_bus_vtable *wsbrd_dbus_vtable; | ^~~~~~~~~~~~~~~~~`

skilau avatar Feb 16 '25 20:02 skilau

Applied onto our private development branch, thank you very much for your contribution! This should be released in version 2.3.1.

MathisMARION avatar Feb 18 '25 09:02 MathisMARION