meson: Add a xcb-keysyms dependency
authorKonstantin Seurer <konstantin.seurer@gmail.com>
Sun, 8 Jan 2023 15:44:12 +0000 (16:44 +0100)
committerMarge Bot <emma+marge@anholt.net>
Tue, 27 Jun 2023 06:25:56 +0000 (06:25 +0000)
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20573>

meson.build
src/vulkan/meson.build

index f9b0438..3073570 100644 (file)
@@ -1928,6 +1928,7 @@ dep_xext = null_dep
 dep_xfixes = null_dep
 dep_x11_xcb = null_dep
 dep_xcb = null_dep
+dep_xcb_keysyms = null_dep
 dep_xcb_glx = null_dep
 dep_xcb_dri2 = null_dep
 dep_xcb_dri3 = null_dep
@@ -1953,6 +1954,7 @@ if host_machine.cpu_family() == 'x86_64' and cc.get_id() == 'gcc'
 endif
 
 with_dri3_modifiers = false
+with_xcb_keysyms = false
 if with_platform_x11
   if with_glx == 'xlib'
     dep_x11 = dependency('x11')
@@ -1970,6 +1972,11 @@ if with_platform_x11
        (with_gallium_vdpau or with_gallium_va or
         with_gallium_omx != 'disabled'))
     dep_xcb = dependency('xcb')
+    dep_xcb_keysyms = dependency('xcb-keysyms', required : false)
+    with_xcb_keysyms = dep_xcb_keysyms.found()
+    if with_xcb_keysyms
+      pre_args += '-DXCB_KEYSYMS_AVAILABLE'
+    endif
     dep_x11_xcb = dependency('x11-xcb')
     if with_dri_platform == 'drm' and not dep_libdrm.found()
       error('libdrm required for gallium video statetrackers when using x11')
index eaa4454..4202d70 100644 (file)
@@ -63,6 +63,9 @@ if with_platform_x11
   ]
   vulkan_wsi_list += '-DVK_USE_PLATFORM_XCB_KHR'
   vulkan_wsi_list += '-DVK_USE_PLATFORM_XLIB_KHR'
+  if with_xcb_keysyms
+    vulkan_wsi_deps += dep_xcb_keysyms
+  endif
 endif
 if with_platform_wayland
   vulkan_wsi_deps += dep_wayland_client