diff options
author | 2019-01-19 12:30:13 +1300 | |
---|---|---|
committer | 2019-01-19 12:30:13 +1300 | |
commit | 1cce14e7c7ee78acacbe7210d177a96048a4e74b (patch) | |
tree | c176209dc608e5c9db4a7d1e69a61d1cd9fd78df /meson.build | |
parent | Merge pull request #3452 from emersion/meson-features (diff) | |
parent | meson: make sure wlroots has been built with xwayland (diff) | |
download | sway-1cce14e7c7ee78acacbe7210d177a96048a4e74b.tar.gz sway-1cce14e7c7ee78acacbe7210d177a96048a4e74b.tar.zst sway-1cce14e7c7ee78acacbe7210d177a96048a4e74b.zip |
Merge pull request #3464 from emersion/meson-check-wlroots-xwayland
Make sure wlroots has been built with xwayland
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/meson.build b/meson.build index bb1c4ddf..0d0f7339 100644 --- a/meson.build +++ b/meson.build | |||
@@ -36,7 +36,6 @@ endif | |||
36 | 36 | ||
37 | jsonc = dependency('json-c', version: '>=0.13') | 37 | jsonc = dependency('json-c', version: '>=0.13') |
38 | pcre = dependency('libpcre') | 38 | pcre = dependency('libpcre') |
39 | wlroots = dependency('wlroots', fallback: ['wlroots', 'wlroots']) | ||
40 | wayland_server = dependency('wayland-server') | 39 | wayland_server = dependency('wayland-server') |
41 | wayland_client = dependency('wayland-client') | 40 | wayland_client = dependency('wayland-client') |
42 | wayland_cursor = dependency('wayland-cursor') | 41 | wayland_cursor = dependency('wayland-cursor') |
@@ -57,7 +56,21 @@ math = cc.find_library('m') | |||
57 | rt = cc.find_library('rt') | 56 | rt = cc.find_library('rt') |
58 | git = find_program('git', required: false) | 57 | git = find_program('git', required: false) |
59 | 58 | ||
60 | have_xwayland = xcb.found() | 59 | # Try first to find wlroots as a subproject, then as a system dependency |
60 | wlroots_proj = subproject('wlroots', required: false) | ||
61 | if wlroots_proj.found() | ||
62 | wlroots = wlroots_proj.get_variable('wlroots') | ||
63 | wlroots_conf = wlroots_proj.get_variable('conf_data') | ||
64 | wlroots_has_xwayland = wlroots_conf.get('WLR_HAS_XWAYLAND') == 1 | ||
65 | else | ||
66 | wlroots = dependency('wlroots') | ||
67 | wlroots_has_xwayland = cc.get_define('WLR_HAS_XWAYLAND', prefix: '#include <wlr/config.h>', dependencies: wlroots) == '1' | ||
68 | endif | ||
69 | |||
70 | if get_option('xwayland').enabled() and not wlroots_has_xwayland | ||
71 | error('Cannot enable Xwayland in sway: wlroots has been built without Xwayland support') | ||
72 | endif | ||
73 | have_xwayland = xcb.found() and wlroots_has_xwayland | ||
61 | 74 | ||
62 | tray_deps_found = systemd.found() or elogind.found() | 75 | tray_deps_found = systemd.found() or elogind.found() |
63 | if get_option('tray').enabled() and not tray_deps_found | 76 | if get_option('tray').enabled() and not tray_deps_found |