meson: Refine build_dbus

As in autotools build, only turn on build_dbus (build dbus-core.c) if it's
needed by build_hal or build_systemd_logind, not just because dbus is
available.

Building dbus-core.c without NEED_DBUS defined fails, as the contents of
dbus-core.h are turned off.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Acked-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Jon TURNEY 2017-05-08 11:40:21 +01:00 committed by Adam Jackson
parent 820a4cbe9f
commit 16054647ab
1 changed files with 3 additions and 3 deletions

View File

@ -72,10 +72,8 @@ if host_machine.system() == 'windows'
hal_option = 'no'
endif
build_dbus = dbus_dep.found()
if get_option('systemd_logind') == 'auto'
build_systemd_logind = build_udev and build_dbus
build_systemd_logind = build_udev and dbus_dep.found()
else
build_systemd_logind = get_option('systemd_logind') == 'yes'
endif
@ -177,6 +175,8 @@ if build_udev and build_hal
error('Hotplugging through both libudev and hal not allowed')
endif
build_dbus = build_hal or build_systemd_logind
udev_dep = []
if build_udev
udev_dep = dependency('libudev', version: '>= 143')