xref: /aosp_15_r20/external/mesa3d/src/vulkan/meson.build (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1# Copyright © 2017 Intel Corporation
2# SPDX-License-Identifier: MIT
3
4vk_api_xml = files('registry/vk.xml')
5
6vulkan_icd_link_args = []
7vulkan_icd_link_depends = []
8
9if with_platform_android
10  vulkan_icd_symbols = files('vulkan-icd-android-symbols.txt')
11  if with_ld_version_script
12    vulkan_icd_link_args += ['-Wl,--version-script', join_paths(meson.current_source_dir(), 'vulkan-android.sym')]
13    vulkan_icd_link_depends += files('vulkan-android.sym')
14  endif
15else
16  vulkan_icd_symbols = files('vulkan-icd-symbols.txt')
17  if with_ld_version_script
18    vulkan_icd_link_args += ['-Wl,--version-script', join_paths(meson.current_source_dir(), 'vulkan.sym')]
19    vulkan_icd_link_depends += files('vulkan.sym')
20  endif
21endif
22
23inc_vulkan_util = include_directories('util')
24
25vulkan_wsi_deps = []
26vulkan_wsi_list = []
27
28vulkan_api_def = custom_target(
29  'vulkan_api.def',
30  input: 'vulkan_api.def.in',
31  output : 'vulkan_api.def',
32  command : gen_vs_module_defs_normal_command,
33)
34
35if with_platform_x11
36  vulkan_wsi_deps += [
37    dep_xcb,
38    dep_x11_xcb,
39    dep_xcb_dri3,
40    dep_xcb_present,
41    dep_xcb_xfixes,
42    dep_xcb_sync,
43    dep_xcb_xrandr,
44    dep_xcb_shm,
45    dep_xshmfence,
46  ]
47  vulkan_wsi_list += '-DVK_USE_PLATFORM_XCB_KHR'
48  vulkan_wsi_list += '-DVK_USE_PLATFORM_XLIB_KHR'
49  if with_xcb_keysyms
50    vulkan_wsi_deps += dep_xcb_keysyms
51  endif
52endif
53if with_platform_wayland
54  vulkan_wsi_deps += dep_wayland_client
55  vulkan_wsi_list += '-DVK_USE_PLATFORM_WAYLAND_KHR'
56endif
57if system_has_kms_drm and not with_platform_android
58  vulkan_wsi_deps += [dep_libdrm]
59  vulkan_wsi_list += '-DVK_USE_PLATFORM_DISPLAY_KHR'
60endif
61if with_xlib_lease
62  vulkan_wsi_deps += [dep_xlib_xrandr]
63  vulkan_wsi_list += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
64endif
65if with_platform_android
66  vulkan_wsi_list += '-DVK_USE_PLATFORM_ANDROID_KHR'
67endif
68if with_platform_windows
69  vulkan_wsi_list += '-DVK_USE_PLATFORM_WIN32_KHR'
70endif
71if with_platform_macos
72  vulkan_wsi_list += '-DVK_USE_PLATFORM_MACOS_MVK'
73  vulkan_wsi_list += '-DVK_USE_PLATFORM_METAL_EXT'
74  vulkan_wsi_deps += dependency(
75    'appleframeworks',
76    modules : ['QuartzCore', 'Metal']
77  )
78endif
79
80idep_vulkan_wsi_defines = declare_dependency(
81  compile_args : vulkan_wsi_list,
82  dependencies : vulkan_wsi_deps,
83)
84vulkan_wsi_deps += idep_vulkan_wsi_defines
85
86subdir('util')
87subdir('runtime')
88subdir('wsi')
89if with_vulkan_overlay_layer
90  subdir('overlay-layer')
91endif
92if with_vulkan_device_select_layer
93  subdir('device-select-layer')
94endif
95if with_vulkan_screenshot_layer
96  subdir('screenshot-layer')
97endif
98