From da0de3caf62023d2b507ed3d66a0b0daa7104c4a Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Thu, 6 Apr 2023 16:13:17 +0200 Subject: [PATCH] xwayland: Fix build without GBM The present code in Xwayland cannot be used without GBM, so if GBM is not available (or too old), the build would fail. Make sure we do not use the present code without GBM support. Signed-off-by: Olivier Fourdan --- hw/xwayland/meson.build | 6 ++++-- hw/xwayland/xwayland-screen.c | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/xwayland/meson.build b/hw/xwayland/meson.build index e24f39a75..b76d205b2 100644 --- a/hw/xwayland/meson.build +++ b/hw/xwayland/meson.build @@ -97,7 +97,10 @@ if build_glamor srcs += 'xwayland-glx.c' endif if gbm_dep.found() - srcs += 'xwayland-glamor-gbm.c' + srcs += [ + 'xwayland-glamor-gbm.c', + 'xwayland-present.c' + ] endif if build_eglstream eglstream_protodir = eglstream_dep.get_pkgconfig_variable('pkgdatadir') @@ -111,7 +114,6 @@ if build_glamor srcs += 'xwayland-glamor-eglstream.c' endif - srcs += 'xwayland-present.c' if build_xv srcs += 'xwayland-glamor-xv.c' endif diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c index 46ab4fed7..ac7238b96 100644 --- a/hw/xwayland/xwayland-screen.c +++ b/hw/xwayland/xwayland-screen.c @@ -943,10 +943,11 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) xwl_screen->glamor = 0; } } - +#ifdef GLAMOR_HAS_GBM if (xwl_screen->glamor && xwl_screen->rootless) xwl_screen->present = xwl_present_init(pScreen); -#endif +#endif /* GLAMOR_HAS_GBM */ +#endif /* XWL_HAS_GLAMOR */ if (!xwl_screen->glamor) { xwl_screen->CreateScreenResources = pScreen->CreateScreenResources;