vkgears ignores -Dx11=disabled if libxcb + libxkbcommon are found
vkgears (unlike vkcube) doesn't support VK_KHR_display
, so without Wayland+X11 there should be nothing but due to required
being bool
instead of feature
the dependency itself isn't disabled thus VK_KHR_xcb_surface
support is always built.
$ meson setup --auto-features=disabled -Dvulkan=enabled /tmp/demos_build
$ meson compile -C /tmp/demos_build
$ ls -R /tmp/demos_build/src/vulkan
vkgears vkgears.p
/tmp/demos_build/src/vulkan/vkgears.p:
gear.frag.spv.h gear.vert.spv.h vkgears.c.o wsi_wsi.c.o wsi_xcb.c.o
Workaround:
diff --git a/meson.build b/meson.build
index 1739b2f3..25b2e9e1 100644
--- a/meson.build
+++ b/meson.build
@@ -55,10 +55,12 @@ dep_x11 = dependency('x11, xext',
required : get_option('x11'),
disabler : true
)
+if dep_vulkan.found()
dep_xcb = dependency('xcb, xkbcommon, xkbcommon-x11',
- required : get_option('x11').enabled() and dep_vulkan.found(),
+ required : get_option('x11'),
disabler : true
)
+endif
dep_wayland = dependency('wayland-client, wayland-egl, xkbcommon',
required : get_option('wayland'),
disabler : true