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 <ofourdan@redhat.com>
This commit is contained in:
Olivier Fourdan 2023-04-06 16:13:17 +02:00
parent c24910d0e1
commit da0de3caf6
2 changed files with 7 additions and 4 deletions

View File

@ -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

View File

@ -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;