meson: Build Xwayland unconditionally

And simplify build_glamor logic, we don't need the separate
glamor_option variable anymore.

(cherry picked from commit fdc61c5a3c)
(cherry picked from commit 274d54d1c3)

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1483>
This commit is contained in:
Michel Dänzer 2020-10-23 12:40:41 +02:00 committed by Olivier Fourdan
parent 6b100681d6
commit 9cd94d3976
2 changed files with 30 additions and 61 deletions

View file

@ -167,45 +167,31 @@ else
default_font_path = dfp
endif
glamor_option = get_option('glamor')
build_glamor = get_option('glamor')
with_dtrace = get_option('dtrace')
if with_dtrace
dtrace = find_program('dtrace', required: true)
endif
libxcvt_dep = dependency('libxcvt', fallback: ['libxcvt', 'libxcvt_dep'], required: false)
build_xwayland = false
if (host_machine.system() != 'darwin' and
host_machine.system() != 'windows' and
get_option('xwayland') != 'false')
xwayland_required = get_option('xwayland') == 'true'
build_glamor = glamor_option == 'true' or glamor_option == 'auto'
libxcvt_dep = dependency('libxcvt', fallback: ['libxcvt', 'libxcvt_dep'], required: true)
build_xwayland = true
xwayland_path = get_option('xwayland-path')
if (xwayland_path == '')
xwayland_path = join_paths(get_option('prefix'), get_option('bindir'))
endif
xwayland_path = get_option('xwayland-path')
if (xwayland_path == '')
xwayland_path = join_paths(get_option('prefix'), get_option('bindir'))
endif
xwayland_dep = [
dependency('wayland-client', version: wayland_req, required: xwayland_required),
dependency('wayland-protocols', version: wayland_protocols_req, required: xwayland_required),
dependency('libxcvt', fallback: ['libxcvt', 'libxcvt_dep'], required: xwayland_required),
]
xwayland_dep = [
dependency('wayland-client', version: wayland_req, required: true),
dependency('wayland-protocols', version: wayland_protocols_req, required: true),
dependency('libxcvt', fallback: ['libxcvt', 'libxcvt_dep'], required: true),
]
if build_glamor
xwayland_dep += dependency('xshmfence', version: xshmfence_req, required: xwayland_required)
xwayland_dep += dependency('libdrm', version: libdrm_req, required: xwayland_required)
xwayland_dep += dependency('epoxy', required: xwayland_required)
endif
build_xwayland = true
# check for all the deps being found, to handle 'auto' mode.
foreach d: xwayland_dep
if not d.found()
build_xwayland = false
endif
endforeach
if build_glamor
xwayland_dep += dependency('xshmfence', version: xshmfence_req, required: true)
xwayland_dep += dependency('libdrm', version: libdrm_req, required: true)
xwayland_dep += dependency('epoxy', required: true)
endif
if get_option('ipv6') == 'auto'
@ -214,12 +200,6 @@ else
build_ipv6 = get_option('ipv6') == 'true'
endif
if glamor_option == 'auto'
build_glamor = build_xwayland
else
build_glamor = glamor_option == 'true'
endif
gbm_dep = dependency('', required: false)
epoxy_dep = dependency('', required: false)
if build_glamor
@ -227,31 +207,22 @@ if build_glamor
epoxy_dep = dependency('epoxy', required: false)
endif
if build_xwayland
libdecor_dep = dependency('libdecor-0', required: false)
libdecor_option = get_option('libdecor')
if libdecor_option == 'auto'
have_libdecor = libdecor_dep.found()
else
have_libdecor = libdecor_option == 'true'
if have_libdecor and not libdecor_dep.found()
error('libdecor support requested but not found')
endif
libdecor_dep = dependency('libdecor-0', required: false)
libdecor_option = get_option('libdecor')
if libdecor_option == 'auto'
have_libdecor = libdecor_dep.found()
else
have_libdecor = libdecor_option == 'true'
if have_libdecor and not libdecor_dep.found()
error('libdecor support requested but not found')
endif
else
have_libdecor = false
endif
if build_xwayland
libei_dep = dependency('libei-1.0', version: '>= 1.0.0', required: get_option('xwayland_ei') in ['portal', 'socket'])
liboeffis_dep = dependency('liboeffis-1.0', version: '>= 1.0.0', required: get_option('xwayland_ei') == 'portal')
libei_dep = dependency('libei-1.0', version: '>= 1.0.0', required: get_option('xwayland_ei') in ['portal', 'socket'])
liboeffis_dep = dependency('liboeffis-1.0', version: '>= 1.0.0', required: get_option('xwayland_ei') == 'portal')
build_ei = libei_dep.found() and get_option('xwayland_ei') != 'false'
build_ei_portal = liboeffis_dep.found() and get_option('xwayland_ei') in ['portal', 'auto']
else
build_ei = false
build_ei_portal = false
endif
build_ei = libei_dep.found() and get_option('xwayland_ei') != 'false'
build_ei_portal = liboeffis_dep.found() and get_option('xwayland_ei') in ['portal', 'auto']
# Lots of sha1 options, because Linux is about choice :)

View file

@ -1,7 +1,5 @@
option('xwayland', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto',
description: 'Enable Xwayland X server')
option('glamor', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto',
description: 'Enable glamor (default yes for Xwayland builds)')
option('glamor', type: 'boolean', value: true,
description: 'Enable glamor (default yes)')
option('xwayland_ei', type: 'combo', choices: ['socket', 'portal', 'false', 'auto'],
value: 'auto', description: 'Enable emulated input support on Xwayland')
option('xvfb', type: 'boolean', value: true,