diff options
-rw-r--r-- | meson.build | 16 | ||||
-rw-r--r-- | meson_options.txt | 4 | ||||
-rw-r--r-- | sway/meson.build | 2 | ||||
-rw-r--r-- | swaybar/meson.build | 4 |
4 files changed, 16 insertions, 10 deletions
diff --git a/meson.build b/meson.build index 2285cbdf..8acf0f2c 100644 --- a/meson.build +++ b/meson.build | |||
@@ -2,6 +2,7 @@ project( | |||
2 | 'sway', | 2 | 'sway', |
3 | 'c', | 3 | 'c', |
4 | license: 'MIT', | 4 | license: 'MIT', |
5 | meson_version: '>=0.48.0', | ||
5 | default_options: [ | 6 | default_options: [ |
6 | 'c_std=c11', | 7 | 'c_std=c11', |
7 | 'warning_level=2', | 8 | 'warning_level=2', |
@@ -53,21 +54,26 @@ libpam = cc.find_library('pam', required: false) | |||
53 | crypt = cc.find_library('crypt', required: false) | 54 | crypt = cc.find_library('crypt', required: false) |
54 | systemd = dependency('libsystemd', required: false) | 55 | systemd = dependency('libsystemd', required: false) |
55 | elogind = dependency('libelogind', required: false) | 56 | elogind = dependency('libelogind', required: false) |
57 | xcb = dependency('xcb', required: get_option('xwayland')) | ||
56 | math = cc.find_library('m') | 58 | math = cc.find_library('m') |
57 | rt = cc.find_library('rt') | 59 | rt = cc.find_library('rt') |
58 | git = find_program('git', required: false) | 60 | git = find_program('git', required: false) |
59 | 61 | ||
60 | conf_data = configuration_data() | 62 | have_xwayland = xcb.found() |
61 | 63 | ||
62 | conf_data.set10('HAVE_XWAYLAND', get_option('enable-xwayland')) | 64 | tray_deps_found = systemd.found() or elogind.found() |
63 | if get_option('enable-xwayland') | 65 | if get_option('tray').enabled() and not tray_deps_found |
64 | xcb = dependency('xcb') | 66 | error('Building with -Dtray=enabled, but libsystemd and libelogind have not been not found') |
65 | endif | 67 | endif |
68 | have_tray = (not get_option('tray').disabled()) and tray_deps_found | ||
69 | |||
70 | conf_data = configuration_data() | ||
66 | 71 | ||
72 | conf_data.set10('HAVE_XWAYLAND', have_xwayland) | ||
67 | conf_data.set10('HAVE_GDK_PIXBUF', gdk_pixbuf.found()) | 73 | conf_data.set10('HAVE_GDK_PIXBUF', gdk_pixbuf.found()) |
68 | conf_data.set10('HAVE_SYSTEMD', systemd.found()) | 74 | conf_data.set10('HAVE_SYSTEMD', systemd.found()) |
69 | conf_data.set10('HAVE_ELOGIND', elogind.found()) | 75 | conf_data.set10('HAVE_ELOGIND', elogind.found()) |
70 | conf_data.set10('HAVE_TRAY', get_option('enable-tray') and (systemd.found() or elogind.found())) | 76 | conf_data.set10('HAVE_TRAY', have_tray) |
71 | 77 | ||
72 | if not systemd.found() and not elogind.found() | 78 | if not systemd.found() and not elogind.found() |
73 | warning('The sway binary must be setuid when compiled without (e)logind') | 79 | warning('The sway binary must be setuid when compiled without (e)logind') |
diff --git a/meson_options.txt b/meson_options.txt index 4640618e..81eee66f 100644 --- a/meson_options.txt +++ b/meson_options.txt | |||
@@ -5,5 +5,5 @@ option('default-wallpaper', type: 'boolean', value: true, description: 'Install | |||
5 | option('zsh-completions', type: 'boolean', value: true, description: 'Install zsh shell completions.') | 5 | option('zsh-completions', type: 'boolean', value: true, description: 'Install zsh shell completions.') |
6 | option('bash-completions', type: 'boolean', value: true, description: 'Install bash shell completions.') | 6 | option('bash-completions', type: 'boolean', value: true, description: 'Install bash shell completions.') |
7 | option('fish-completions', type: 'boolean', value: true, description: 'Install fish shell completions.') | 7 | option('fish-completions', type: 'boolean', value: true, description: 'Install fish shell completions.') |
8 | option('enable-xwayland', type: 'boolean', value: true, description: 'Enable support for X11 applications') | 8 | option('xwayland', type: 'feature', value: 'auto', description: 'Enable support for X11 applications') |
9 | option('enable-tray', type: 'boolean', value: false, description: 'Enable support for swaybar tray') | 9 | option('tray', type: 'feature', value: 'auto', description: 'Enable support for swaybar tray') |
diff --git a/sway/meson.build b/sway/meson.build index 0a08ee74..2388a66d 100644 --- a/sway/meson.build +++ b/sway/meson.build | |||
@@ -194,7 +194,7 @@ sway_deps = [ | |||
194 | xkbcommon, | 194 | xkbcommon, |
195 | ] | 195 | ] |
196 | 196 | ||
197 | if get_option('enable-xwayland') | 197 | if have_xwayland |
198 | sway_sources += 'desktop/xwayland.c' | 198 | sway_sources += 'desktop/xwayland.c' |
199 | sway_deps += xcb | 199 | sway_deps += xcb |
200 | endif | 200 | endif |
diff --git a/swaybar/meson.build b/swaybar/meson.build index 312ca97b..a44c0061 100644 --- a/swaybar/meson.build +++ b/swaybar/meson.build | |||
@@ -1,4 +1,4 @@ | |||
1 | tray_files = get_option('enable-tray') ? [ | 1 | tray_files = have_tray ? [ |
2 | 'tray/host.c', | 2 | 'tray/host.c', |
3 | 'tray/icon.c', | 3 | 'tray/icon.c', |
4 | 'tray/item.c', | 4 | 'tray/item.c', |
@@ -19,7 +19,7 @@ swaybar_deps = [ | |||
19 | wayland_cursor, | 19 | wayland_cursor, |
20 | wlroots, | 20 | wlroots, |
21 | ] | 21 | ] |
22 | if get_option('enable-tray') | 22 | if have_tray |
23 | if systemd.found() | 23 | if systemd.found() |
24 | swaybar_deps += systemd | 24 | swaybar_deps += systemd |
25 | elif elogind.found() | 25 | elif elogind.found() |