aboutsummaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2021-10-24 21:34:36 +0200
committerLibravatar Simon Zeni <simon@bl4ckb0ne.ca>2021-11-26 12:10:18 -0600
commit02b412a3d4e930237a1d16554af6e1e7d1855c89 (patch)
tree6797990e47b0dc2d53275e0261a37b530fad0790 /meson.build
parentsway: replace noop_output by fallback_output (diff)
downloadsway-02b412a3d4e930237a1d16554af6e1e7d1855c89.tar.gz
sway-02b412a3d4e930237a1d16554af6e1e7d1855c89.tar.zst
sway-02b412a3d4e930237a1d16554af6e1e7d1855c89.zip
build: use list for sdbus dep
This allows to simplify our logic. Meson will pick the first found library.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build23
1 files changed, 4 insertions, 19 deletions
diff --git a/meson.build b/meson.build
index 436b84d1..72bce0ee 100644
--- a/meson.build
+++ b/meson.build
@@ -3,7 +3,7 @@ project(
3 'c', 3 'c',
4 version: '1.6', 4 version: '1.6',
5 license: 'MIT', 5 license: 'MIT',
6 meson_version: '>=0.59.0', 6 meson_version: '>=0.60.0',
7 default_options: [ 7 default_options: [
8 'c_std=c11', 8 'c_std=c11',
9 'warning_level=2', 9 'warning_level=2',
@@ -92,30 +92,15 @@ if get_option('sd-bus-provider') == 'auto'
92 if not get_option('tray').disabled() 92 if not get_option('tray').disabled()
93 assert(get_option('auto_features').auto(), 'sd-bus-provider must not be set to auto since auto_features != auto') 93 assert(get_option('auto_features').auto(), 'sd-bus-provider must not be set to auto since auto_features != auto')
94 endif 94 endif
95 sdbus = dependency('libsystemd', 95 sdbus = dependency(['libsystemd', 'libelogind', 'basu'],
96 required: false, 96 required: get_option('tray'),
97 version: '>=239', 97 version: '>=239',
98 not_found_message: 'libsystemd not found, trying libelogind',
99 ) 98 )
100 if not sdbus.found()
101 sdbus = dependency('libelogind',
102 required: false,
103 version: '>=239',
104 not_found_message: 'libelogind not found, trying basu',
105 )
106 endif
107 if not sdbus.found()
108 sdbus = dependency('basu', required: false)
109 endif
110else 99else
111 sdbus = dependency(get_option('sd-bus-provider'), required: get_option('tray')) 100 sdbus = dependency(get_option('sd-bus-provider'), required: get_option('tray'))
112endif 101endif
113 102
114tray_deps_found = sdbus.found() 103have_tray = sdbus.found()
115if get_option('tray').enabled() and not tray_deps_found
116 error('Building with -Dtray=enabled, but sd-bus has not been not found')
117endif
118have_tray = (not get_option('tray').disabled()) and tray_deps_found
119 104
120conf_data = configuration_data() 105conf_data = configuration_data()
121 106