meson: reuse vulkan_wsi_list for defining vk_wsi_args

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19497>
This commit is contained in:
Eric Engestrom
2022-11-03 10:13:16 +00:00
committed by Marge Bot
parent 22c1f4be8c
commit f059213f5d
2 changed files with 16 additions and 28 deletions

View File

@@ -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') \

View File

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