aboutsummaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2019-01-17 18:02:25 +0100
committerLibravatar emersion <contact@emersion.fr>2019-01-17 18:26:24 +0100
commit08a5b304e4334020f46752697ad0e7cde54229f4 (patch)
tree4debab2293c5ea1fe6172805e35a1d78ad2b3482 /meson.build
parentMerge pull request #3447 from emersion/remove-swaylock-includes (diff)
downloadsway-08a5b304e4334020f46752697ad0e7cde54229f4.tar.gz
sway-08a5b304e4334020f46752697ad0e7cde54229f4.tar.zst
sway-08a5b304e4334020f46752697ad0e7cde54229f4.zip
Use Meson feature options
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build16
1 files changed, 11 insertions, 5 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)
53crypt = cc.find_library('crypt', required: false) 54crypt = cc.find_library('crypt', required: false)
54systemd = dependency('libsystemd', required: false) 55systemd = dependency('libsystemd', required: false)
55elogind = dependency('libelogind', required: false) 56elogind = dependency('libelogind', required: false)
57xcb = dependency('xcb', required: get_option('xwayland'))
56math = cc.find_library('m') 58math = cc.find_library('m')
57rt = cc.find_library('rt') 59rt = cc.find_library('rt')
58git = find_program('git', required: false) 60git = find_program('git', required: false)
59 61
60conf_data = configuration_data() 62have_xwayland = xcb.found()
61 63
62conf_data.set10('HAVE_XWAYLAND', get_option('enable-xwayland')) 64tray_deps_found = systemd.found() or elogind.found()
63if get_option('enable-xwayland') 65if 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')
65endif 67endif
68have_tray = (not get_option('tray').disabled()) and tray_deps_found
69
70conf_data = configuration_data()
66 71
72conf_data.set10('HAVE_XWAYLAND', have_xwayland)
67conf_data.set10('HAVE_GDK_PIXBUF', gdk_pixbuf.found()) 73conf_data.set10('HAVE_GDK_PIXBUF', gdk_pixbuf.found())
68conf_data.set10('HAVE_SYSTEMD', systemd.found()) 74conf_data.set10('HAVE_SYSTEMD', systemd.found())
69conf_data.set10('HAVE_ELOGIND', elogind.found()) 75conf_data.set10('HAVE_ELOGIND', elogind.found())
70conf_data.set10('HAVE_TRAY', get_option('enable-tray') and (systemd.found() or elogind.found())) 76conf_data.set10('HAVE_TRAY', have_tray)
71 77
72if not systemd.found() and not elogind.found() 78if 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')