From 9adcf440776b2aa1749ea9b25066e12c68f534fc Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Mon, 31 Dec 2018 12:29:12 +0200 Subject: [PATCH] meson: better error for logind deps Helps people to disable logind support if they do not want the dependencies. Signed-off-by: Pekka Paalanen --- libweston/meson.build | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libweston/meson.build b/libweston/meson.build index 6c87552e..d4d0ef7a 100644 --- a/libweston/meson.build +++ b/libweston/meson.build @@ -122,8 +122,17 @@ if get_option('launcher-logind') if systemd_dep.found() config_h.set('HAVE_SYSTEMD_LOGIN_209', '1') else - systemd_dep = dependency('libsystemd-login', version: '>= 198') + systemd_dep = dependency('libsystemd-login', version: '>= 198', required: false) + if not systemd_dep.found() + error('logind support requires libsystemd or libsystemd-login but neither was found. Or, you can use \'-Dlauncher-logind=false\'') + endif + 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 \'-Dlauncher-logind=false\'') endif + config_h.set('HAVE_DBUS', '1') config_h.set('HAVE_SYSTEMD_LOGIN', '1') @@ -132,7 +141,7 @@ if get_option('launcher-logind') 'launcher-logind.c', ] deps_session_helper += [ - dependency('dbus-1', version: '>= 1.6'), + dbus_dep, systemd_dep, ] endif