build: unify vulkan cpp platform args
these were duplicated all over the place, and it's annoying to have to keep duplicating them any time a new component includes the vulkan header Reviewed-by: Dylan Baker <dylan@pnwbakers.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13141>
This commit is contained in:

committed by
Marge Bot

parent
1d574d4860
commit
7cc85dba71
28
meson.build
28
meson.build
@@ -414,6 +414,34 @@ else
|
|||||||
with_xlib_lease = _xlib_lease == 'enabled'
|
with_xlib_lease = _xlib_lease == 'enabled'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if with_platform_wayland
|
||||||
|
c_args += '-DVK_USE_PLATFORM_WAYLAND_KHR'
|
||||||
|
cpp_args += '-DVK_USE_PLATFORM_WAYLAND_KHR'
|
||||||
|
endif
|
||||||
|
if with_platform_x11
|
||||||
|
c_args += ['-DVK_USE_PLATFORM_XCB_KHR', '-DVK_USE_PLATFORM_XLIB_KHR']
|
||||||
|
#add this once aco and other places can build with it
|
||||||
|
#cpp_args += ['-DVK_USE_PLATFORM_XCB_KHR', '-DVK_USE_PLATFORM_XLIB_KHR']
|
||||||
|
endif
|
||||||
|
if with_platform_windows
|
||||||
|
c_args += '-DVK_USE_PLATFORM_WIN32_KHR'
|
||||||
|
#add this once aco and other places can build with it
|
||||||
|
#cpp_args += '-DVK_USE_PLATFORM_WIN32_KHR'
|
||||||
|
endif
|
||||||
|
if with_platform_android
|
||||||
|
c_args += '-DVK_USE_PLATFORM_ANDROID_KHR'
|
||||||
|
cpp_args += '-DVK_USE_PLATFORM_ANDROID_KHR'
|
||||||
|
endif
|
||||||
|
if with_xlib_lease
|
||||||
|
c_args += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
|
||||||
|
#add this once aco and other places can build with it
|
||||||
|
#cpp_args += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
|
||||||
|
endif
|
||||||
|
if system_has_kms_drm and not with_platform_android
|
||||||
|
c_args += '-DVK_USE_PLATFORM_DISPLAY_KHR'
|
||||||
|
cpp_args += '-DVK_USE_PLATFORM_DISPLAY_KHR'
|
||||||
|
endif
|
||||||
|
|
||||||
_egl = get_option('egl')
|
_egl = get_option('egl')
|
||||||
if _egl == 'true'
|
if _egl == 'true'
|
||||||
_egl = 'enabled'
|
_egl = 'enabled'
|
||||||
|
@@ -113,40 +113,24 @@ radv_flags = cc.get_supported_arguments(['-Wimplicit-fallthrough', '-Wshadow'])
|
|||||||
|
|
||||||
if with_platform_x11
|
if with_platform_x11
|
||||||
radv_deps += dep_xcb_dri3
|
radv_deps += dep_xcb_dri3
|
||||||
radv_flags += [
|
|
||||||
'-DVK_USE_PLATFORM_XCB_KHR',
|
|
||||||
'-DVK_USE_PLATFORM_XLIB_KHR',
|
|
||||||
]
|
|
||||||
libradv_files += files('radv_wsi_x11.c')
|
libradv_files += files('radv_wsi_x11.c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if with_platform_wayland
|
if with_platform_wayland
|
||||||
radv_deps += dep_wayland_client
|
radv_deps += dep_wayland_client
|
||||||
radv_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
|
|
||||||
libradv_files += files('radv_wsi_wayland.c')
|
libradv_files += files('radv_wsi_wayland.c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if system_has_kms_drm and not with_platform_android
|
if system_has_kms_drm and not with_platform_android
|
||||||
radv_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
|
|
||||||
libradv_files += files('radv_wsi_display.c')
|
libradv_files += files('radv_wsi_display.c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if with_xlib_lease
|
if with_xlib_lease
|
||||||
radv_deps += [dep_xlib_xrandr]
|
radv_deps += [dep_xlib_xrandr]
|
||||||
radv_flags += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if with_platform_android
|
if with_platform_android
|
||||||
radv_deps += dep_android
|
radv_deps += dep_android
|
||||||
radv_flags += [
|
|
||||||
'-DVK_USE_PLATFORM_ANDROID_KHR'
|
|
||||||
]
|
|
||||||
endif
|
|
||||||
|
|
||||||
if with_platform_windows
|
|
||||||
radv_flags += [
|
|
||||||
'-DVK_USE_PLATFORM_WIN32_KHR',
|
|
||||||
]
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# When static linking LLVM, all its symbols are public API.
|
# When static linking LLVM, all its symbols are public API.
|
||||||
|
@@ -90,22 +90,16 @@ v3dv_deps = [
|
|||||||
|
|
||||||
if with_platform_x11
|
if with_platform_x11
|
||||||
v3dv_deps += dep_xcb_dri3
|
v3dv_deps += dep_xcb_dri3
|
||||||
v3dv_flags += [
|
|
||||||
'-DVK_USE_PLATFORM_XCB_KHR',
|
|
||||||
'-DVK_USE_PLATFORM_XLIB_KHR',
|
|
||||||
]
|
|
||||||
libv3dv_files += files('v3dv_wsi_x11.c')
|
libv3dv_files += files('v3dv_wsi_x11.c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if with_platform_wayland
|
if with_platform_wayland
|
||||||
v3dv_deps += [dep_wayland_client, dep_wl_protocols]
|
v3dv_deps += [dep_wayland_client, dep_wl_protocols]
|
||||||
v3dv_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
|
|
||||||
libv3dv_files += files('v3dv_wsi_wayland.c')
|
libv3dv_files += files('v3dv_wsi_wayland.c')
|
||||||
libv3dv_files += [wayland_drm_client_protocol_h, wayland_drm_protocol_c]
|
libv3dv_files += [wayland_drm_client_protocol_h, wayland_drm_protocol_c]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if system_has_kms_drm and not with_platform_android
|
if system_has_kms_drm and not with_platform_android
|
||||||
v3dv_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
|
|
||||||
libv3dv_files += files('v3dv_wsi_display.c')
|
libv3dv_files += files('v3dv_wsi_display.c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@@ -62,23 +62,17 @@ tu_wsi = false
|
|||||||
|
|
||||||
if with_platform_x11
|
if with_platform_x11
|
||||||
tu_deps += dep_xcb_dri3
|
tu_deps += dep_xcb_dri3
|
||||||
tu_flags += [
|
|
||||||
'-DVK_USE_PLATFORM_XCB_KHR',
|
|
||||||
'-DVK_USE_PLATFORM_XLIB_KHR',
|
|
||||||
]
|
|
||||||
libtu_files += files('tu_wsi_x11.c')
|
libtu_files += files('tu_wsi_x11.c')
|
||||||
tu_wsi = true
|
tu_wsi = true
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if with_platform_wayland
|
if with_platform_wayland
|
||||||
tu_deps += dep_wayland_client
|
tu_deps += dep_wayland_client
|
||||||
tu_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
|
|
||||||
libtu_files += files('tu_wsi_wayland.c')
|
libtu_files += files('tu_wsi_wayland.c')
|
||||||
tu_wsi = true
|
tu_wsi = true
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if system_has_kms_drm and not with_platform_android
|
if system_has_kms_drm and not with_platform_android
|
||||||
tu_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
|
|
||||||
libtu_files += files('tu_wsi_display.c')
|
libtu_files += files('tu_wsi_display.c')
|
||||||
tu_wsi = true
|
tu_wsi = true
|
||||||
endif
|
endif
|
||||||
@@ -89,14 +83,12 @@ if tu_wsi
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if with_platform_android
|
if with_platform_android
|
||||||
tu_flags += '-DVK_USE_PLATFORM_ANDROID_KHR'
|
|
||||||
libtu_files += files('tu_android.c')
|
libtu_files += files('tu_android.c')
|
||||||
tu_deps += [dep_android]
|
tu_deps += [dep_android]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if with_xlib_lease
|
if with_xlib_lease
|
||||||
tu_deps += [dep_xlib_xrandr]
|
tu_deps += [dep_xlib_xrandr]
|
||||||
tu_flags += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if with_freedreno_kgsl
|
if with_freedreno_kgsl
|
||||||
|
@@ -43,21 +43,15 @@ lvp_flags = []
|
|||||||
|
|
||||||
if with_platform_x11
|
if with_platform_x11
|
||||||
lvp_deps += dep_xcb_dri3
|
lvp_deps += dep_xcb_dri3
|
||||||
lvp_flags += [
|
|
||||||
'-DVK_USE_PLATFORM_XCB_KHR',
|
|
||||||
'-DVK_USE_PLATFORM_XLIB_KHR',
|
|
||||||
]
|
|
||||||
liblvp_files += files('lvp_wsi_x11.c')
|
liblvp_files += files('lvp_wsi_x11.c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if with_platform_wayland
|
if with_platform_wayland
|
||||||
lvp_deps += dep_wayland_client
|
lvp_deps += dep_wayland_client
|
||||||
lvp_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
|
|
||||||
liblvp_files += files('lvp_wsi_wayland.c')
|
liblvp_files += files('lvp_wsi_wayland.c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if with_platform_windows
|
if with_platform_windows
|
||||||
lvp_flags += '-DVK_USE_PLATFORM_WIN32_KHR'
|
|
||||||
liblvp_files += files('lvp_wsi_win32.c')
|
liblvp_files += files('lvp_wsi_win32.c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@@ -125,31 +125,23 @@ anv_flags = [
|
|||||||
|
|
||||||
if with_platform_x11
|
if with_platform_x11
|
||||||
anv_deps += dep_xcb_dri3
|
anv_deps += dep_xcb_dri3
|
||||||
anv_flags += [
|
|
||||||
'-DVK_USE_PLATFORM_XCB_KHR',
|
|
||||||
'-DVK_USE_PLATFORM_XLIB_KHR',
|
|
||||||
]
|
|
||||||
libanv_files += files('anv_wsi_x11.c')
|
libanv_files += files('anv_wsi_x11.c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if with_platform_wayland
|
if with_platform_wayland
|
||||||
anv_deps += dep_wayland_client
|
anv_deps += dep_wayland_client
|
||||||
anv_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
|
|
||||||
libanv_files += files('anv_wsi_wayland.c')
|
libanv_files += files('anv_wsi_wayland.c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if system_has_kms_drm and not with_platform_android
|
if system_has_kms_drm and not with_platform_android
|
||||||
anv_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
|
|
||||||
libanv_files += files('anv_wsi_display.c')
|
libanv_files += files('anv_wsi_display.c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if with_xlib_lease
|
if with_xlib_lease
|
||||||
anv_deps += [dep_xlib_xrandr]
|
anv_deps += [dep_xlib_xrandr]
|
||||||
anv_flags += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if with_platform_android
|
if with_platform_android
|
||||||
anv_flags += '-DVK_USE_PLATFORM_ANDROID_KHR'
|
|
||||||
libanv_files += files('anv_android.c')
|
libanv_files += files('anv_android.c')
|
||||||
else
|
else
|
||||||
libanv_files += files('anv_android_stubs.c')
|
libanv_files += files('anv_android_stubs.c')
|
||||||
|
@@ -95,13 +95,11 @@ foreach arch : ['5', '6', '7']
|
|||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
if system_has_kms_drm
|
if system_has_kms_drm
|
||||||
panvk_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
|
|
||||||
libpanvk_files += files('panvk_wsi_display.c')
|
libpanvk_files += files('panvk_wsi_display.c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if with_platform_wayland
|
if with_platform_wayland
|
||||||
panvk_deps += [dep_wayland_client, dep_wl_protocols]
|
panvk_deps += [dep_wayland_client, dep_wl_protocols]
|
||||||
panvk_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
|
|
||||||
libpanvk_files += files('panvk_wsi_wayland.c')
|
libpanvk_files += files('panvk_wsi_wayland.c')
|
||||||
libpanvk_files += [wayland_drm_client_protocol_h, wayland_drm_protocol_c]
|
libpanvk_files += [wayland_drm_client_protocol_h, wayland_drm_protocol_c]
|
||||||
endif
|
endif
|
||||||
|
@@ -74,22 +74,16 @@ endif
|
|||||||
if with_platform_wayland
|
if with_platform_wayland
|
||||||
libvn_files += files('vn_wsi_wayland.c')
|
libvn_files += files('vn_wsi_wayland.c')
|
||||||
vn_deps += dep_wayland_client
|
vn_deps += dep_wayland_client
|
||||||
vn_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if with_platform_x11
|
if with_platform_x11
|
||||||
libvn_files += files('vn_wsi_x11.c')
|
libvn_files += files('vn_wsi_x11.c')
|
||||||
vn_deps += dep_xcb_dri3
|
vn_deps += dep_xcb_dri3
|
||||||
vn_flags += [
|
|
||||||
'-DVK_USE_PLATFORM_XCB_KHR',
|
|
||||||
'-DVK_USE_PLATFORM_XLIB_KHR',
|
|
||||||
]
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if with_platform_android
|
if with_platform_android
|
||||||
libvn_files += files('vn_android.c')
|
libvn_files += files('vn_android.c')
|
||||||
vn_deps += dep_android
|
vn_deps += dep_android
|
||||||
vn_flags += '-DVK_USE_PLATFORM_ANDROID_KHR'
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
libvulkan_virtio = shared_library(
|
libvulkan_virtio = shared_library(
|
||||||
|
@@ -28,14 +28,12 @@ vklayer_flags = []
|
|||||||
if with_platform_x11
|
if with_platform_x11
|
||||||
vklayer_files += files('device_select_x11.c')
|
vklayer_files += files('device_select_x11.c')
|
||||||
vklayer_deps += dep_xcb_dri3
|
vklayer_deps += dep_xcb_dri3
|
||||||
vklayer_flags += [ '-DVK_USE_PLATFORM_XCB_KHR' ]
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if with_platform_wayland
|
if with_platform_wayland
|
||||||
vklayer_files += files('device_select_wayland.c')
|
vklayer_files += files('device_select_wayland.c')
|
||||||
vklayer_files += [ wayland_drm_client_protocol_h, wayland_drm_protocol_c ]
|
vklayer_files += [ wayland_drm_client_protocol_h, wayland_drm_protocol_c ]
|
||||||
vklayer_deps += [dep_wayland_client, dep_wl_protocols]
|
vklayer_deps += [dep_wayland_client, dep_wl_protocols]
|
||||||
vklayer_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
vklayer_mesa_device_select = shared_library(
|
vklayer_mesa_device_select = shared_library(
|
||||||
|
@@ -29,7 +29,6 @@ vulkan_wsi_deps = []
|
|||||||
vulkan_wsi_list = []
|
vulkan_wsi_list = []
|
||||||
|
|
||||||
if with_platform_x11
|
if with_platform_x11
|
||||||
vulkan_wsi_args += ['-DVK_USE_PLATFORM_XCB_KHR', '-DVK_USE_PLATFORM_XLIB_KHR']
|
|
||||||
vulkan_wsi_deps += [
|
vulkan_wsi_deps += [
|
||||||
dep_xcb,
|
dep_xcb,
|
||||||
dep_x11_xcb,
|
dep_x11_xcb,
|
||||||
@@ -43,20 +42,14 @@ if with_platform_x11
|
|||||||
vulkan_wsi_list += ['xcb', 'x11']
|
vulkan_wsi_list += ['xcb', 'x11']
|
||||||
endif
|
endif
|
||||||
if with_platform_wayland
|
if with_platform_wayland
|
||||||
vulkan_wsi_args += ['-DVK_USE_PLATFORM_WAYLAND_KHR']
|
|
||||||
vulkan_wsi_deps += dep_wayland_client
|
vulkan_wsi_deps += dep_wayland_client
|
||||||
vulkan_wsi_list += ['wayland']
|
vulkan_wsi_list += ['wayland']
|
||||||
endif
|
endif
|
||||||
if with_platform_windows
|
|
||||||
vulkan_wsi_args += ['-DVK_USE_PLATFORM_WIN32_KHR']
|
|
||||||
endif
|
|
||||||
if system_has_kms_drm and not with_platform_android
|
if system_has_kms_drm and not with_platform_android
|
||||||
vulkan_wsi_args += '-DVK_USE_PLATFORM_DISPLAY_KHR'
|
|
||||||
vulkan_wsi_deps += [dep_libdrm]
|
vulkan_wsi_deps += [dep_libdrm]
|
||||||
vulkan_wsi_list += ['drm']
|
vulkan_wsi_list += ['drm']
|
||||||
endif
|
endif
|
||||||
if with_xlib_lease
|
if with_xlib_lease
|
||||||
vulkan_wsi_args += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
|
|
||||||
vulkan_wsi_deps += [dep_xlib_xrandr]
|
vulkan_wsi_deps += [dep_xlib_xrandr]
|
||||||
vulkan_wsi_list += ['xlib_xrandr']
|
vulkan_wsi_list += ['xlib_xrandr']
|
||||||
endif
|
endif
|
||||||
|
Reference in New Issue
Block a user