aboutsummaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2020-12-02 23:46:49 +0100
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2020-12-09 17:39:20 -0500
commitfdbe98512a71524091375290ca2c1c9450e4db84 (patch)
tree1d97201175819f43afa67aa642be8d2a7a48ec18 /meson.build
parentbuild: use WLR_HAS_* to decide whether suid is required (diff)
downloadsway-fdbe98512a71524091375290ca2c1c9450e4db84.tar.gz
sway-fdbe98512a71524091375290ca2c1c9450e4db84.tar.zst
sway-fdbe98512a71524091375290ca2c1c9450e4db84.zip
build: introduce sd-bus-provider option
This allows to select a specific provider for the sd-bus library.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build32
1 files changed, 24 insertions, 8 deletions
diff --git a/meson.build b/meson.build
index ee2fdaaa..9842d78a 100644
--- a/meson.build
+++ b/meson.build
@@ -51,8 +51,6 @@ pixman = dependency('pixman-1')
51glesv2 = dependency('glesv2') 51glesv2 = dependency('glesv2')
52libevdev = dependency('libevdev') 52libevdev = dependency('libevdev')
53libinput = dependency('libinput', version: '>=1.6.0') 53libinput = dependency('libinput', version: '>=1.6.0')
54systemd = dependency('libsystemd', version: '>=239', required: false)
55elogind = dependency('libelogind', version: '>=239', required: false)
56xcb = dependency('xcb', required: get_option('xwayland')) 54xcb = dependency('xcb', required: get_option('xwayland'))
57bash_comp = dependency('bash-completion', required: false) 55bash_comp = dependency('bash-completion', required: false)
58fish_comp = dependency('fish', required: false) 56fish_comp = dependency('fish', required: false)
@@ -93,9 +91,28 @@ if get_option('xwayland').enabled() and not wlroots_features['xwayland']
93endif 91endif
94have_xwayland = xcb.found() and wlroots_features['xwayland'] 92have_xwayland = xcb.found() and wlroots_features['xwayland']
95 93
96tray_deps_found = systemd.found() or elogind.found() 94if get_option('sd-bus-provider') == 'auto'
95 if not get_option('tray').disabled()
96 assert(get_option('auto_features').auto(), 'sd-bus-provider must not be set to auto since auto_features != auto')
97 endif
98 sdbus = dependency('libsystemd',
99 required: false,
100 version: '>=239',
101 not_found_message: 'libsystemd not found, trying libelogind',
102 )
103 if not sdbus.found()
104 sdbus = dependency('libelogind',
105 required: false,
106 version: '>=239',
107 )
108 endif
109else
110 sdbus = dependency(get_option('sd-bus-provider'), required: get_option('tray'))
111endif
112
113tray_deps_found = sdbus.found()
97if get_option('tray').enabled() and not tray_deps_found 114if get_option('tray').enabled() and not tray_deps_found
98 error('Building with -Dtray=enabled, but libsystemd and libelogind have not been not found') 115 error('Building with -Dtray=enabled, but sd-bus has not been not found')
99endif 116endif
100have_tray = (not get_option('tray').disabled()) and tray_deps_found 117have_tray = (not get_option('tray').disabled()) and tray_deps_found
101 118
@@ -103,8 +120,8 @@ conf_data = configuration_data()
103 120
104conf_data.set10('HAVE_XWAYLAND', have_xwayland) 121conf_data.set10('HAVE_XWAYLAND', have_xwayland)
105conf_data.set10('HAVE_GDK_PIXBUF', gdk_pixbuf.found()) 122conf_data.set10('HAVE_GDK_PIXBUF', gdk_pixbuf.found())
106conf_data.set10('HAVE_SYSTEMD', systemd.found()) 123conf_data.set10('HAVE_LIBSYSTEMD', sdbus.found() and sdbus.name() == 'libsystemd')
107conf_data.set10('HAVE_ELOGIND', elogind.found()) 124conf_data.set10('HAVE_LIBELOGIND', sdbus.found() and sdbus.name() == 'libelogind')
108conf_data.set10('HAVE_TRAY', have_tray) 125conf_data.set10('HAVE_TRAY', have_tray)
109 126
110scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: get_option('man-pages')) 127scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: get_option('man-pages'))
@@ -291,8 +308,7 @@ endif
291summary({ 308summary({
292 'xwayland': have_xwayland, 309 'xwayland': have_xwayland,
293 'gdk-pixbuf': gdk_pixbuf.found(), 310 'gdk-pixbuf': gdk_pixbuf.found(),
294 'systemd': systemd.found(), 311 'sd-bus': sdbus.found(),
295 'elogind': elogind.found(),
296 'tray': have_tray, 312 'tray': have_tray,
297 'man-pages': scdoc.found(), 313 'man-pages': scdoc.found(),
298}, bool_yn: true) 314}, bool_yn: true)