meson: generate builddir/src/amd/vulkan/dev_icd.json
[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 : [prog_python2, '@INPUT0@', '--xml', '@INPUT1@',
26 '--outdir', meson.current_build_dir()],
27 )
28
29 vk_format_table_c = custom_target(
30 'vk_format_table.c',
31 input : ['vk_format_table.py', 'vk_format_layout.csv'],
32 output : 'vk_format_table.c',
33 command : [prog_python2, '@INPUT@'],
34 depend_files : files('vk_format_parse.py'),
35 capture : true,
36 )
37
38 libradv_files = files(
39 'winsys/amdgpu/radv_amdgpu_bo.c',
40 'winsys/amdgpu/radv_amdgpu_bo.h',
41 'winsys/amdgpu/radv_amdgpu_cs.c',
42 'winsys/amdgpu/radv_amdgpu_cs.h',
43 'winsys/amdgpu/radv_amdgpu_surface.c',
44 'winsys/amdgpu/radv_amdgpu_surface.h',
45 'winsys/amdgpu/radv_amdgpu_winsys.c',
46 'winsys/amdgpu/radv_amdgpu_winsys.h',
47 'winsys/amdgpu/radv_amdgpu_winsys_public.h',
48 'radv_cmd_buffer.c',
49 'radv_cs.h',
50 'radv_debug.c',
51 'radv_debug.h',
52 'radv_device.c',
53 'radv_descriptor_set.c',
54 'radv_descriptor_set.h',
55 'radv_formats.c',
56 'radv_image.c',
57 'radv_meta.c',
58 'radv_meta.h',
59 'radv_meta_blit.c',
60 'radv_meta_blit2d.c',
61 'radv_meta_buffer.c',
62 'radv_meta_bufimage.c',
63 'radv_meta_clear.c',
64 'radv_meta_copy.c',
65 'radv_meta_decompress.c',
66 'radv_meta_fast_clear.c',
67 'radv_meta_resolve.c',
68 'radv_meta_resolve_cs.c',
69 'radv_meta_resolve_fs.c',
70 'radv_pass.c',
71 'radv_pipeline.c',
72 'radv_pipeline_cache.c',
73 'radv_private.h',
74 'radv_radeon_winsys.h',
75 'radv_shader.c',
76 'radv_shader.h',
77 'radv_query.c',
78 'radv_util.c',
79 'radv_util.h',
80 'radv_wsi.c',
81 'si_cmd_buffer.c',
82 'vk_format.h',
83 )
84
85 radv_deps = []
86 radv_flags = []
87
88 if with_platform_x11
89 radv_deps += dep_xcb_dri3
90 radv_flags += [
91 '-DVK_USE_PLATFORM_XCB_KHR',
92 '-DVK_USE_PLATFORM_XLIB_KHR',
93 ]
94 libradv_files += files('radv_wsi_x11.c')
95 endif
96
97 if with_platform_wayland
98 radv_deps += dep_wayland_client
99 radv_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
100 libradv_files += files('radv_wsi_wayland.c')
101 endif
102
103 libvulkan_radeon = shared_library(
104 'vulkan_radeon',
105 [libradv_files, radv_entrypoints, nir_opcodes_h, vk_format_table_c],
106 include_directories : [inc_common, inc_amd, inc_amd_common, inc_compiler,
107 inc_vulkan_util, inc_vulkan_wsi],
108 link_with : [libamd_common, libamdgpu_addrlib, libvulkan_util,
109 libvulkan_wsi, libnir, libmesa_util],
110 dependencies : [dep_llvm, dep_libdrm_amdgpu, dep_thread, dep_elf, dep_dl,
111 dep_m, dep_valgrind],
112 c_args : [c_vis_args, no_override_init_args, radv_flags],
113 link_args : [ld_args_bsymbolic, ld_args_gc_sections],
114 install : true,
115 )
116
117 radv_data = configuration_data()
118 radv_data.set('install_libdir', join_paths(get_option('prefix'), get_option('libdir')))
119 radv_data.set('libvulkan_radeon_path', libvulkan_radeon.full_path())
120
121 configure_file(
122 configuration : radv_data,
123 input : 'radeon_icd.json.in',
124 output : 'radeon_icd.@0@.json'.format(target_machine.cpu()),
125 install_dir : with_vulkan_icd_dir,
126 )
127 configure_file(
128 configuration : radv_data,
129 input : 'dev_icd.json.in',
130 output : 'dev_icd.json'
131 )