meson: inline `inc_common`
[mesa.git] / src / freedreno / 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 tu_entrypoints = custom_target(
22 'tu_entrypoints.[ch]',
23 input : ['tu_entrypoints_gen.py', vk_api_xml],
24 output : ['tu_entrypoints.h', 'tu_entrypoints.c'],
25 command : [
26 prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--outdir',
27 meson.current_build_dir()
28 ],
29 depend_files : files('tu_extensions.py'),
30 )
31
32 tu_extensions_c = custom_target(
33 'tu_extensions.c',
34 input : ['tu_extensions.py', vk_api_xml],
35 output : ['tu_extensions.c', 'tu_extensions.h'],
36 command : [
37 prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--out-c', '@OUTPUT0@',
38 '--out-h', '@OUTPUT1@'
39 ],
40 )
41
42 libtu_files = files(
43 'tu_blit.c',
44 'tu_blit.h',
45 'tu_cmd_buffer.c',
46 'tu_cs.c',
47 'tu_cs.h',
48 'tu_device.c',
49 'tu_descriptor_set.c',
50 'tu_descriptor_set.h',
51 'tu_drm.c',
52 'tu_fence.c',
53 'tu_formats.c',
54 'tu_image.c',
55 'tu_meta_blit.c',
56 'tu_meta_buffer.c',
57 'tu_meta_clear.c',
58 'tu_meta_copy.c',
59 'tu_meta_resolve.c',
60 'tu_pass.c',
61 'tu_pipeline.c',
62 'tu_pipeline_cache.c',
63 'tu_private.h',
64 'tu_query.c',
65 'tu_shader.c',
66 'tu_util.c',
67 'tu_util.h',
68 'tu_wsi.c',
69 'vk_format.h',
70 )
71
72 tu_deps = []
73 tu_flags = []
74
75 if with_platform_x11
76 tu_deps += dep_xcb_dri3
77 tu_flags += [
78 '-DVK_USE_PLATFORM_XCB_KHR',
79 '-DVK_USE_PLATFORM_XLIB_KHR',
80 ]
81 libtu_files += files('tu_wsi_x11.c')
82 endif
83
84 if with_platform_wayland
85 tu_deps += dep_wayland_client
86 tu_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
87 libtu_files += files('tu_wsi_wayland.c')
88 endif
89
90 if with_platform_drm
91 tu_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
92 libtu_files += files('tu_wsi_display.c')
93 endif
94
95 if with_xlib_lease
96 tu_deps += [dep_xcb_xrandr, dep_xlib_xrandr]
97 tu_flags += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
98 endif
99
100 libvulkan_freedreno = shared_library(
101 'vulkan_freedreno',
102 [libtu_files, tu_entrypoints, tu_extensions_c, freedreno_xml_header_files],
103 include_directories : [
104 inc_include,
105 inc_src,
106 inc_mapi,
107 inc_mesa,
108 inc_gallium,
109 inc_gallium_aux,
110 inc_compiler,
111 inc_vulkan_wsi,
112 inc_freedreno,
113 ],
114 link_with : [
115 libvulkan_wsi,
116 libfreedreno_drm, # required by ir3_shader_get_variant, which we don't use
117 libfreedreno_ir3,
118 libfreedreno_layout,
119 ],
120 dependencies : [
121 dep_dl,
122 dep_elf,
123 dep_libdrm,
124 dep_llvm,
125 dep_m,
126 dep_thread,
127 dep_valgrind,
128 idep_nir,
129 tu_deps,
130 idep_vulkan_util,
131 idep_mesautil,
132 ],
133 c_args : [c_vis_args, no_override_init_args, tu_flags],
134 link_args : [ld_args_bsymbolic, ld_args_gc_sections],
135 install : true,
136 )
137
138 if with_symbols_check
139 test(
140 'tu symbols check',
141 symbols_check,
142 args : [
143 '--lib', libvulkan_freedreno,
144 '--symbols-file', vulkan_icd_symbols,
145 symbols_check_args,
146 ],
147 suite : ['freedreno'],
148 )
149 endif
150
151 freedreno_icd = custom_target(
152 'freedreno_icd',
153 input : 'tu_icd.py',
154 output : 'freedreno_icd.@0@.json'.format(host_machine.cpu()),
155 command : [
156 prog_python, '@INPUT@',
157 '--lib-path', join_paths(get_option('prefix'), get_option('libdir')),
158 '--out', '@OUTPUT@',
159 ],
160 depend_files : files('tu_extensions.py'),
161 build_by_default : true,
162 install_dir : with_vulkan_icd_dir,
163 install : true,
164 )