build: Check for Xwayland -enable-ei-portal option

Enabling portal support unconditionally breaks when running nested, so
Xwayland has now a new command line option to explicitly enable support
for XDG portal at runtime.

Check whether the version of Xwayland we are using has such an option.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3303>
This commit is contained in:
Olivier Fourdan 2023-09-29 11:00:37 +02:00 committed by Marge Bot
parent 6cfdbef3c2
commit 4d587a8bcd
2 changed files with 15 additions and 0 deletions

View File

@ -112,3 +112,6 @@
/* Defined if libdisplay-info is enabled */
#mesondefine HAVE_LIBDISPLAY_INFO
/* Whether the Xwayland has -enable-ei-portal option */
#mesondefine HAVE_XWAYLAND_ENABLE_EI_PORTAL

View File

@ -555,6 +555,7 @@ have_xwayland_initfd = false
have_xwayland_listenfd = false
have_xwayland_terminate_delay = false
have_xwayland_byte_swapped_clients = false
have_xwayland_enable_ei_portal = false
if have_xwayland
xwayland_dep = dependency('xwayland', required: false)
@ -626,6 +627,16 @@ if have_xwayland
if (have_xwayland_byte_swapped_clients)
cdata.set('HAVE_XWAYLAND_BYTE_SWAPPED_CLIENTS', 1)
endif
# For Xwayland -enable-portal usage
if xwayland_dep.found()
have_xwayland_enable_ei_portal = xwayland_dep.get_variable('have_enable_ei_portal',
default_value: 'false') == 'true'
endif
if (have_xwayland_enable_ei_portal)
cdata.set('HAVE_XWAYLAND_ENABLE_EI_PORTAL', 1)
endif
endif
optional_functions = [
@ -710,6 +721,7 @@ summary('Xwayland initfd', have_xwayland_initfd, section: 'Options')
summary('Xwayland listenfd', have_xwayland_listenfd, section: 'Options')
summary('Xwayland terminate delay', have_xwayland_terminate_delay, section: 'Options')
summary('Xwayland byte-swapped clients', have_xwayland_byte_swapped_clients, section: 'Options')
summary('Xwayland enable EI portal', have_xwayland_enable_ei_portal, section: 'Options')
summary('Enabled', have_tests, section: 'Tests')
summary('Core tests', have_core_tests, section: 'Tests')