radv: implement a dummy winsys for creating devices without AMDGPU
[mesa.git] / src / amd / vulkan / meson.build
1 # Copyright © 2017 Intel Corporation
2
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to deal
5 # in the Software without restriction, including without limitation the rights
6 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 # copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
9
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
12
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 # SOFTWARE.
20
21 radv_entrypoints = custom_target(
22 'radv_entrypoints.[ch]',
23 input : ['radv_entrypoints_gen.py', vk_api_xml],
24 output : ['radv_entrypoints.h', 'radv_entrypoints.c'],
25 command : [
26 prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--outdir',
27 meson.current_build_dir()
28 ],
29 depend_files : files('radv_extensions.py'),
30 )
31
32 radv_extensions_c = custom_target(
33 'radv_extensions.c',
34 input : ['radv_extensions.py', vk_api_xml],
35 output : ['radv_extensions.c', 'radv_extensions.h'],
36 command : [
37 prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--out-c', '@OUTPUT0@',
38 '--out-h', '@OUTPUT1@'
39 ],
40 )
41
42 amd_vk_format_table_c = custom_target(
43 'amd_vk_format_table.c',
44 input : ['vk_format_table.py', 'vk_format_layout.csv'],
45 output : 'vk_format_table.c',
46 command : [prog_python, '@INPUT@'],
47 depend_files : files('vk_format_parse.py'),
48 capture : true,
49 )
50
51 radv_gfx10_format_table_h = custom_target(
52 'radv_gfx10_format_table.h',
53 input : ['gfx10_format_table.py', 'vk_format_layout.csv', '../registers/gfx10-rsrc.json'],
54 output : 'gfx10_format_table.h',
55 command : [prog_python, '@INPUT@'],
56 capture : true,
57 depend_files : files('../registers/regdb.py')
58 )
59
60 libradv_files = files(
61 'winsys/amdgpu/radv_amdgpu_bo.c',
62 'winsys/amdgpu/radv_amdgpu_bo.h',
63 'winsys/amdgpu/radv_amdgpu_cs.c',
64 'winsys/amdgpu/radv_amdgpu_cs.h',
65 'winsys/amdgpu/radv_amdgpu_surface.c',
66 'winsys/amdgpu/radv_amdgpu_surface.h',
67 'winsys/amdgpu/radv_amdgpu_winsys.c',
68 'winsys/amdgpu/radv_amdgpu_winsys.h',
69 'winsys/amdgpu/radv_amdgpu_winsys_public.h',
70 'winsys/null/radv_null_bo.c',
71 'winsys/null/radv_null_bo.h',
72 'winsys/null/radv_null_cs.c',
73 'winsys/null/radv_null_cs.h',
74 'winsys/null/radv_null_winsys.c',
75 'winsys/null/radv_null_winsys_public.h',
76 'radv_android.c',
77 'radv_cmd_buffer.c',
78 'radv_cs.h',
79 'radv_debug.c',
80 'radv_debug.h',
81 'radv_device.c',
82 'radv_descriptor_set.c',
83 'radv_descriptor_set.h',
84 'radv_formats.c',
85 'radv_image.c',
86 'radv_llvm_helper.cpp',
87 'radv_meta.c',
88 'radv_meta.h',
89 'radv_meta_blit.c',
90 'radv_meta_blit2d.c',
91 'radv_meta_buffer.c',
92 'radv_meta_bufimage.c',
93 'radv_meta_clear.c',
94 'radv_meta_copy.c',
95 'radv_meta_decompress.c',
96 'radv_meta_fast_clear.c',
97 'radv_meta_fmask_expand.c',
98 'radv_meta_resolve.c',
99 'radv_meta_resolve_cs.c',
100 'radv_meta_resolve_fs.c',
101 'radv_nir_lower_ycbcr_textures.c',
102 'radv_nir_to_llvm.c',
103 'radv_pass.c',
104 'radv_pipeline.c',
105 'radv_pipeline_cache.c',
106 'radv_private.h',
107 'radv_radeon_winsys.h',
108 'radv_shader.c',
109 'radv_shader.h',
110 'radv_shader_args.c',
111 'radv_shader_args.h',
112 'radv_shader_helper.h',
113 'radv_shader_info.c',
114 'radv_query.c',
115 'radv_util.c',
116 'radv_util.h',
117 'radv_wsi.c',
118 'si_cmd_buffer.c',
119 'vk_format.h',
120 )
121
122 radv_deps = []
123 radv_flags = []
124
125 if with_platform_x11
126 radv_deps += dep_xcb_dri3
127 radv_flags += [
128 '-DVK_USE_PLATFORM_XCB_KHR',
129 '-DVK_USE_PLATFORM_XLIB_KHR',
130 ]
131 libradv_files += files('radv_wsi_x11.c')
132 endif
133
134 if with_platform_wayland
135 radv_deps += dep_wayland_client
136 radv_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
137 libradv_files += files('radv_wsi_wayland.c')
138 endif
139
140 if with_platform_drm
141 radv_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
142 libradv_files += files('radv_wsi_display.c')
143 endif
144
145 if with_xlib_lease
146 radv_deps += [dep_xcb_xrandr, dep_xlib_xrandr]
147 radv_flags += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
148 endif
149
150 if with_platform_android
151 radv_deps += dep_android
152 radv_flags += [
153 '-DVK_USE_PLATFORM_ANDROID_KHR'
154 ]
155 endif
156
157 libvulkan_radeon = shared_library(
158 'vulkan_radeon',
159 [libradv_files, radv_entrypoints, radv_extensions_c, amd_vk_format_table_c, sha1_h, radv_gfx10_format_table_h],
160 include_directories : [
161 inc_common, inc_amd, inc_amd_common, inc_amd_common_llvm, inc_compiler, inc_util, inc_vulkan_wsi,
162 ],
163 link_with : [
164 libamd_common, libamd_common_llvm, libamdgpu_addrlib, libvulkan_wsi,
165 ],
166 dependencies : [
167 dep_llvm, dep_libdrm_amdgpu, dep_thread, dep_elf, dep_dl, dep_m,
168 dep_valgrind, radv_deps, idep_aco,
169 idep_mesautil, idep_nir, idep_vulkan_util, idep_amdgfxregs_h, idep_xmlconfig,
170 ],
171 c_args : [c_vis_args, no_override_init_args, radv_flags],
172 cpp_args : [cpp_vis_args, radv_flags],
173 link_args : [ld_args_bsymbolic, ld_args_gc_sections],
174 install : true,
175 )
176
177 if with_symbols_check
178 test(
179 'radv symbols check',
180 symbols_check,
181 args : [
182 '--lib', libvulkan_radeon,
183 '--symbols-file', vulkan_icd_symbols,
184 symbols_check_args,
185 ],
186 suite : ['amd'],
187 )
188 endif
189
190 radeon_icd = custom_target(
191 'radeon_icd',
192 input : 'radv_icd.py',
193 output : 'radeon_icd.@0@.json'.format(host_machine.cpu()),
194 command : [
195 prog_python, '@INPUT@',
196 '--lib-path', join_paths(get_option('prefix'), get_option('libdir')),
197 '--out', '@OUTPUT@',
198 ],
199 depend_files : files('radv_extensions.py'),
200 build_by_default : true,
201 install_dir : with_vulkan_icd_dir,
202 install : true,
203 )