meson/xwayland: No libdrm nor epoxy without glamor

When building Xwayland with neither DRI nor GLamor support enabled with
the Meson build system, the resulting binary would still link against
libdrm and epoxy even though those are not used/needed.

Make sure we require and link against libdrm and epoxy only if needed.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
This commit is contained in:
Olivier Fourdan 2019-08-01 13:34:13 +02:00 committed by Adam Jackson
parent e8a85ba818
commit aed62f8fbe
2 changed files with 8 additions and 4 deletions

View File

@ -94,7 +94,7 @@ conf_data.set('NEED_DBUS', build_systemd_logind or build_hal)
conf_data.set('CONFIG_WSCONS', host_machine.system() == 'openbsd') conf_data.set('CONFIG_WSCONS', host_machine.system() == 'openbsd')
conf_data.set('HAVE_XSHMFENCE', xshmfence_dep.found()) conf_data.set('HAVE_XSHMFENCE', xshmfence_dep.found())
conf_data.set('WITH_LIBDRM', libdrm_dep.found()) conf_data.set('WITH_LIBDRM', libdrm_required)
conf_data.set('GLAMOR_HAS_EGL_QUERY_DMABUF', conf_data.set('GLAMOR_HAS_EGL_QUERY_DMABUF',
epoxy_dep.found() and epoxy_dep.version().version_compare('>= 1.4.4')) epoxy_dep.found() and epoxy_dep.version().version_compare('>= 1.4.4'))
conf_data.set('GLXEXT', build_glx) conf_data.set('GLXEXT', build_glx)

View File

@ -192,14 +192,18 @@ if (host_machine.system() != 'darwin' and
host_machine.system() != 'windows') host_machine.system() != 'windows')
if get_option('xwayland') != 'false' if get_option('xwayland') != 'false'
xwayland_required = get_option('xwayland') == 'true' xwayland_required = get_option('xwayland') == 'true'
build_glamor = glamor_option == 'true' or glamor_option == 'auto'
xwayland_dep = [ xwayland_dep = [
dependency('wayland-client', version: wayland_req, required: xwayland_required), dependency('wayland-client', version: wayland_req, required: xwayland_required),
dependency('wayland-protocols', version: wayland_protocols_req, required: xwayland_required), dependency('wayland-protocols', version: wayland_protocols_req, required: xwayland_required),
dependency('libdrm', version: libdrm_req, required: xwayland_required),
dependency('epoxy', required: xwayland_required),
] ]
if build_glamor
xwayland_dep += dependency('libdrm', version: libdrm_req, required: xwayland_required)
xwayland_dep += dependency('epoxy', required: xwayland_required)
endif
build_xwayland = true build_xwayland = true
# check for all the deps being found, to handle 'auto' mode. # check for all the deps being found, to handle 'auto' mode.
foreach d: xwayland_dep foreach d: xwayland_dep
@ -309,7 +313,7 @@ module_dir = join_paths(get_option('libdir'), get_option('module_dir'))
if glamor_option == 'auto' if glamor_option == 'auto'
build_glamor = build_xorg or build_xwayland build_glamor = build_xorg or build_xwayland
else else
build_glamor = get_option('glamor') == 'true' build_glamor = glamor_option == 'true'
endif endif
gbm_dep = dependency('', required: false) gbm_dep = dependency('', required: false)