diff options
author | Simon Ser <contact@emersion.fr> | 2020-12-02 23:46:49 +0100 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2020-12-09 17:39:20 -0500 |
commit | fdbe98512a71524091375290ca2c1c9450e4db84 (patch) | |
tree | 1d97201175819f43afa67aa642be8d2a7a48ec18 /meson.build | |
parent | build: use WLR_HAS_* to decide whether suid is required (diff) | |
download | sway-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.build | 32 |
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') | |||
51 | glesv2 = dependency('glesv2') | 51 | glesv2 = dependency('glesv2') |
52 | libevdev = dependency('libevdev') | 52 | libevdev = dependency('libevdev') |
53 | libinput = dependency('libinput', version: '>=1.6.0') | 53 | libinput = dependency('libinput', version: '>=1.6.0') |
54 | systemd = dependency('libsystemd', version: '>=239', required: false) | ||
55 | elogind = dependency('libelogind', version: '>=239', required: false) | ||
56 | xcb = dependency('xcb', required: get_option('xwayland')) | 54 | xcb = dependency('xcb', required: get_option('xwayland')) |
57 | bash_comp = dependency('bash-completion', required: false) | 55 | bash_comp = dependency('bash-completion', required: false) |
58 | fish_comp = dependency('fish', required: false) | 56 | fish_comp = dependency('fish', required: false) |
@@ -93,9 +91,28 @@ if get_option('xwayland').enabled() and not wlroots_features['xwayland'] | |||
93 | endif | 91 | endif |
94 | have_xwayland = xcb.found() and wlroots_features['xwayland'] | 92 | have_xwayland = xcb.found() and wlroots_features['xwayland'] |
95 | 93 | ||
96 | tray_deps_found = systemd.found() or elogind.found() | 94 | if 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 | ||
109 | else | ||
110 | sdbus = dependency(get_option('sd-bus-provider'), required: get_option('tray')) | ||
111 | endif | ||
112 | |||
113 | tray_deps_found = sdbus.found() | ||
97 | if get_option('tray').enabled() and not tray_deps_found | 114 | if 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') |
99 | endif | 116 | endif |
100 | have_tray = (not get_option('tray').disabled()) and tray_deps_found | 117 | have_tray = (not get_option('tray').disabled()) and tray_deps_found |
101 | 118 | ||
@@ -103,8 +120,8 @@ conf_data = configuration_data() | |||
103 | 120 | ||
104 | conf_data.set10('HAVE_XWAYLAND', have_xwayland) | 121 | conf_data.set10('HAVE_XWAYLAND', have_xwayland) |
105 | conf_data.set10('HAVE_GDK_PIXBUF', gdk_pixbuf.found()) | 122 | conf_data.set10('HAVE_GDK_PIXBUF', gdk_pixbuf.found()) |
106 | conf_data.set10('HAVE_SYSTEMD', systemd.found()) | 123 | conf_data.set10('HAVE_LIBSYSTEMD', sdbus.found() and sdbus.name() == 'libsystemd') |
107 | conf_data.set10('HAVE_ELOGIND', elogind.found()) | 124 | conf_data.set10('HAVE_LIBELOGIND', sdbus.found() and sdbus.name() == 'libelogind') |
108 | conf_data.set10('HAVE_TRAY', have_tray) | 125 | conf_data.set10('HAVE_TRAY', have_tray) |
109 | 126 | ||
110 | scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: get_option('man-pages')) | 127 | scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: get_option('man-pages')) |
@@ -291,8 +308,7 @@ endif | |||
291 | summary({ | 308 | summary({ |
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) |