Module: Mesa
Branch: main
Commit: f059213f5dd510c22b1e0af102be6984aa715038
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f059213f5dd510c22b1e0af102be6984aa715038

Author: Eric Engestrom <[email protected]>
Date:   Thu Nov  3 10:13:16 2022 +0000

meson: reuse vulkan_wsi_list for defining vk_wsi_args

Signed-off-by: Eric Engestrom <[email protected]>
Reviewed-by: Erik Faye-Lund <[email protected]>
Reviewed-by: Yonggang Luo <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19497>

---

 meson.build            | 24 ------------------------
 src/vulkan/meson.build | 20 ++++++++++++++++----
 2 files changed, 16 insertions(+), 28 deletions(-)

diff --git a/meson.build b/meson.build
index 621f0675489..4fe0dd6d036 100644
--- a/meson.build
+++ b/meson.build
@@ -376,30 +376,6 @@ with_xlib_lease = get_option('xlib-lease') \
   .require(with_platform_x11 and system_has_kms_drm, error_message : 
'xlib-lease requires X11 and KMS/DRM support') \
   .allowed()
 
-vk_wsi_args = []
-
-if with_platform_wayland
-  vk_wsi_args += '-DVK_USE_PLATFORM_WAYLAND_KHR'
-endif
-if with_platform_x11
-  vk_wsi_args += ['-DVK_USE_PLATFORM_XCB_KHR', '-DVK_USE_PLATFORM_XLIB_KHR']
-endif
-if with_platform_windows
-  vk_wsi_args += '-DVK_USE_PLATFORM_WIN32_KHR'
-endif
-if with_platform_android
-  vk_wsi_args += '-DVK_USE_PLATFORM_ANDROID_KHR'
-endif
-if with_xlib_lease
-  vk_wsi_args += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
-endif
-if system_has_kms_drm and not with_platform_android
-  vk_wsi_args += '-DVK_USE_PLATFORM_DISPLAY_KHR'
-endif
-if host_machine.system() == 'darwin'
-  vk_wsi_args += ['-DVK_USE_PLATFORM_MACOS_MVK', '-DVK_USE_PLATFORM_METAL_EXT']
-endif
-
 with_egl = get_option('egl') \
   .require(host_machine.system() != 'darwin', error_message : 'EGL not 
supported on MacOS') \
   .require(with_platform_windows or with_platform_haiku or with_dri or 
with_platform_android, error_message : 'EGL requires DRI, Haiku, Windows or 
Android') \
diff --git a/src/vulkan/meson.build b/src/vulkan/meson.build
index 6a95768c5e8..aa5addcfce7 100644
--- a/src/vulkan/meson.build
+++ b/src/vulkan/meson.build
@@ -45,21 +45,33 @@ if with_platform_x11
     dep_xcb_shm,
     dep_xshmfence,
   ]
-  vulkan_wsi_list += ['xcb', 'x11']
+  vulkan_wsi_list += '-DVK_USE_PLATFORM_XCB_KHR'
+  vulkan_wsi_list += '-DVK_USE_PLATFORM_XLIB_KHR'
 endif
 if with_platform_wayland
   vulkan_wsi_deps += dep_wayland_client
-  vulkan_wsi_list += ['wayland']
+  vulkan_wsi_list += '-DVK_USE_PLATFORM_WAYLAND_KHR'
 endif
 if system_has_kms_drm and not with_platform_android
   vulkan_wsi_deps += [dep_libdrm]
-  vulkan_wsi_list += ['drm']
+  vulkan_wsi_list += '-DVK_USE_PLATFORM_DISPLAY_KHR'
 endif
 if with_xlib_lease
   vulkan_wsi_deps += [dep_xlib_xrandr]
-  vulkan_wsi_list += ['xlib_xrandr']
+  vulkan_wsi_list += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
+endif
+if with_platform_android
+  vulkan_wsi_list += '-DVK_USE_PLATFORM_ANDROID_KHR'
+endif
+if with_platform_windows
+  vulkan_wsi_list += '-DVK_USE_PLATFORM_WIN32_KHR'
+endif
+if host_machine.system() == 'darwin'
+  vulkan_wsi_list += '-DVK_USE_PLATFORM_MACOS_MVK'
+  vulkan_wsi_list += '-DVK_USE_PLATFORM_METAL_EXT'
 endif
 
+vk_wsi_args = vulkan_wsi_list
 
 subdir('util')
 subdir('runtime')

Reply via email to