build: add xwayland meson option

Allows disabling XWayland support at build time via -Dxwayland=disabled,
even when wlroots was built with XWayland. Defaults to auto.
This commit is contained in:
David Cohen 2026-04-02 03:01:02 -05:00
parent b7c3dba382
commit 71a33b0443
2 changed files with 7 additions and 1 deletions

View file

@ -40,7 +40,12 @@ wayland_server = dependency('wayland-server')
xkbcommon = dependency('xkbcommon') xkbcommon = dependency('xkbcommon')
math = cc.find_library('m') math = cc.find_library('m')
have_xwayland = wlroots.get_variable(pkgconfig: 'have_xwayland', internal: 'have_xwayland') == 'true' xwayland_opt = get_option('xwayland')
_wlroots_has_xwayland = wlroots.get_variable(pkgconfig: 'have_xwayland', internal: 'have_xwayland') == 'true'
if xwayland_opt.enabled() and not _wlroots_has_xwayland
error('wlroots was built without XWayland support')
endif
have_xwayland = _wlroots_has_xwayland and not xwayland_opt.disabled()
version = '@0@'.format(meson.project_version()) version = '@0@'.format(meson.project_version())
git = find_program('git', native: true, required: false) git = find_program('git', native: true, required: false)

View file

@ -1 +1,2 @@
option('man-pages', type: 'feature', value: 'auto', description: 'Generate and install man pages') option('man-pages', type: 'feature', value: 'auto', description: 'Generate and install man pages')
option('xwayland', type: 'feature', value: 'auto', description: 'Enable XWayland support')