libweston: Split dbus support into seperate build option

Currently dbus support is built when launcher-logind option
is set; let's split that such that dbus is its own option
and launcher-logind depends on dbus.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
This commit is contained in:
Christopher Obbard 2022-03-11 11:52:43 +00:00 committed by Daniel Stone
parent 9e36620be7
commit 463ebda4e4
5 changed files with 59 additions and 8 deletions

View File

@ -21,6 +21,7 @@ backend_vnc_h = files('backend-vnc.h')
backend_wayland_h = files('backend-wayland.h')
backend_x11_h = files('backend-x11.h')
dbus_h = files('dbus.h')
xwayland_api_h = files('xwayland-api.h')
libweston_version_h = configuration_data()

View File

@ -0,0 +1,38 @@
if not get_option('dbus')
dep_dbus = declare_dependency()
subdir_done()
endif
dbus_dep = dependency('dbus-1', version: '>= 1.6', required: false)
if not dbus_dep.found()
error('dbus support requires dbus-1 >= 1.6 which was not found. Or, you can use \'-Ddbus=false\'')
endif
config_h.set('HAVE_DBUS', '1')
srcs_dbus = [
'dbus.c',
]
deps_dbus = [
dep_libweston_private,
dbus_dep,
]
lib_dbus = static_library(
'dbus',
srcs_dbus,
include_directories: common_inc,
dependencies: deps_dbus,
name_prefix: '',
install: true,
install_dir: dir_module_libweston
)
dep_dbus = declare_dependency(
link_with: lib_dbus,
dependencies: deps_dbus,
include_directories: include_directories('.')
)
install_headers(dbus_h, subdir: dir_include_libweston_install)

View File

@ -172,38 +172,43 @@ if get_option('backend-drm')
endif
systemd_dep = dependency('', required: false)
subdir('dbus')
if get_option('deprecated-launcher-logind')
if not get_option('dbus')
error('dbus support is required for deprecated-launcher-logind')
endif
systemd_dep = dependency('libsystemd', version: '>= 209', required: false)
if not systemd_dep.found()
error('logind support requires libsystemd >= 209. Or, you can use \'-Ddeprecated-launcher-logind=false\'')
endif
dbus_dep = dependency('dbus-1', version: '>= 1.6', required: false)
if not dbus_dep.found()
error('logind support requires dbus-1 >= 1.6 which was not found. Or, you can use \'-Ddeprecated-launcher-logind=false\'')
endif
config_h.set('HAVE_DBUS', '1')
config_h.set('HAVE_SYSTEMD_LOGIN', '1')
srcs_session_helper += [
'dbus.c',
'launcher-logind.c',
]
deps_session_helper += [
dbus_dep,
dep_dbus,
systemd_dep,
]
warning('deprecated-launcher-logind is enabled. This will go away, see https://gitlab.freedesktop.org/wayland/weston/-/issues/488')
endif
if get_option('launcher-libseat')
if not get_option('dbus')
error('dbus support is required for launcher-libseat')
endif
libseat_dep = dependency('libseat', version: '>= 0.4')
config_h.set('HAVE_LIBSEAT', '1')
srcs_session_helper += [
'launcher-libseat.c',
]
deps_session_helper += [
dep_dbus,
libseat_dep,
]
endif

View File

@ -156,6 +156,13 @@ option(
description: 'DEPRECATED: color management plugin cms-colord (requires cms-static)'
)
option(
'dbus',
type: 'boolean',
value: true,
description: 'D-Bus protocol support'
)
option(
'deprecated-launcher-logind',
type: 'boolean',