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