meson: Fail if initfd is enabled but Xwayland doesn't support it

Fedora's mutter is built with --auto-features=enabled which enables
-initfd support. But the current meson code doesn't check whether
-initfd is available in Xwayland, leading to the wayland session not
starting up.

Check for -initfd's availability before enabling it.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1103
This commit is contained in:
Bastien Nocera 2020-03-03 15:26:06 +01:00 committed by Jonas Dreßler
parent 0730ff5b9e
commit f79d40077e

View File

@ -409,11 +409,14 @@ if have_wayland
# For Xwayland -initfd usage # For Xwayland -initfd usage
use_initfd = get_option('xwayland_initfd') use_initfd = get_option('xwayland_initfd')
xwayland_options = run_command(xwayland_path, '-help')
if use_initfd.auto() if use_initfd.auto()
xwayland_options = run_command(xwayland_path, '-help')
have_xwayland_initfd = xwayland_options.stderr().contains('-initfd') have_xwayland_initfd = xwayland_options.stderr().contains('-initfd')
else else
have_xwayland_initfd = use_initfd.enabled() have_xwayland_initfd = use_initfd.enabled()
if have_xwayland_initfd and not xwayland_options.stderr().contains('-initfd')
error('XWayland -initfd support requested but not available')
endif
endif endif
if (have_xwayland_initfd) if (have_xwayland_initfd)