diff options
author | emersion <contact@emersion.fr> | 2019-01-18 23:32:10 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2019-01-18 23:47:46 +0100 |
commit | 35d73345d9a4fb60dcf791a88d8abfe62d95a142 (patch) | |
tree | c176209dc608e5c9db4a7d1e69a61d1cd9fd78df | |
parent | 639b66b6769722b5decc8f7a21dd7c5037f3c65c (diff) | |
download | sway-35d73345d9a4fb60dcf791a88d8abfe62d95a142.tar.xz |
meson: make sure wlroots has been built with xwayland
-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 jsonc = dependency('json-c', version: '>=0.13') pcre = dependency('libpcre') -wlroots = dependency('wlroots', fallback: ['wlroots', 'wlroots']) wayland_server = dependency('wayland-server') wayland_client = dependency('wayland-client') wayland_cursor = dependency('wayland-cursor') @@ -57,7 +56,21 @@ math = cc.find_library('m') rt = cc.find_library('rt') git = find_program('git', required: false) -have_xwayland = xcb.found() +# Try first to find wlroots as a subproject, then as a system dependency +wlroots_proj = subproject('wlroots', required: false) +if wlroots_proj.found() + wlroots = wlroots_proj.get_variable('wlroots') + wlroots_conf = wlroots_proj.get_variable('conf_data') + wlroots_has_xwayland = wlroots_conf.get('WLR_HAS_XWAYLAND') == 1 +else + wlroots = dependency('wlroots') + wlroots_has_xwayland = cc.get_define('WLR_HAS_XWAYLAND', prefix: '#include <wlr/config.h>', dependencies: wlroots) == '1' +endif + +if get_option('xwayland').enabled() and not wlroots_has_xwayland + error('Cannot enable Xwayland in sway: wlroots has been built without Xwayland support') +endif +have_xwayland = xcb.found() and wlroots_has_xwayland tray_deps_found = systemd.found() or elogind.found() if get_option('tray').enabled() and not tray_deps_found |