bc64d3090f4cf26ecf47d21979506f79246f9724
[mesa.git] / src / gallium / drivers / freedreno / meson.build
1 # Copyright © 2017 Rob Clark
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 ir3_nir_trig_c = custom_target(
22 'ir3_nir_trig.c',
23 input : 'ir3/ir3_nir_trig.py',
24 output : 'ir3_nir_trig.c',
25 command : [prog_python2, '@INPUT@', '-p',
26 join_paths(meson.source_root(), 'src/compiler/nir/')],
27 capture : true,
28 depend_files : nir_algebraic_py,
29 )
30
31 files_libfreedreno = files(
32 'adreno_common.xml.h',
33 'adreno_pm4.xml.h',
34 'disasm.h',
35 'freedreno_batch.c',
36 'freedreno_batch.h',
37 'freedreno_batch_cache.c',
38 'freedreno_batch_cache.h',
39 'freedreno_blitter.c',
40 'freedreno_blitter.h',
41 'freedreno_context.c',
42 'freedreno_context.h',
43 'freedreno_draw.c',
44 'freedreno_draw.h',
45 'freedreno_fence.c',
46 'freedreno_fence.h',
47 'freedreno_gmem.c',
48 'freedreno_gmem.h',
49 'freedreno_program.c',
50 'freedreno_program.h',
51 'freedreno_query.c',
52 'freedreno_query.h',
53 'freedreno_query_acc.c',
54 'freedreno_query_acc.h',
55 'freedreno_query_hw.c',
56 'freedreno_query_hw.h',
57 'freedreno_query_sw.c',
58 'freedreno_query_sw.h',
59 'freedreno_resource.c',
60 'freedreno_resource.h',
61 'freedreno_screen.c',
62 'freedreno_screen.h',
63 'freedreno_state.c',
64 'freedreno_state.h',
65 'freedreno_surface.c',
66 'freedreno_surface.h',
67 'freedreno_texture.c',
68 'freedreno_texture.h',
69 'freedreno_util.c',
70 'freedreno_util.h',
71 'a2xx/a2xx.xml.h',
72 'a2xx/disasm-a2xx.c',
73 'a2xx/fd2_blend.c',
74 'a2xx/fd2_blend.h',
75 'a2xx/fd2_compiler.c',
76 'a2xx/fd2_compiler.h',
77 'a2xx/fd2_context.c',
78 'a2xx/fd2_context.h',
79 'a2xx/fd2_draw.c',
80 'a2xx/fd2_draw.h',
81 'a2xx/fd2_emit.c',
82 'a2xx/fd2_emit.h',
83 'a2xx/fd2_gmem.c',
84 'a2xx/fd2_gmem.h',
85 'a2xx/fd2_program.c',
86 'a2xx/fd2_program.h',
87 'a2xx/fd2_rasterizer.c',
88 'a2xx/fd2_rasterizer.h',
89 'a2xx/fd2_screen.c',
90 'a2xx/fd2_screen.h',
91 'a2xx/fd2_texture.c',
92 'a2xx/fd2_texture.h',
93 'a2xx/fd2_util.c',
94 'a2xx/fd2_util.h',
95 'a2xx/fd2_zsa.c',
96 'a2xx/fd2_zsa.h',
97 'a2xx/instr-a2xx.h',
98 'a2xx/ir-a2xx.c',
99 'a2xx/ir-a2xx.h',
100 'a3xx/a3xx.xml.h',
101 'a3xx/fd3_blend.c',
102 'a3xx/fd3_blend.h',
103 'a3xx/fd3_context.c',
104 'a3xx/fd3_context.h',
105 'a3xx/fd3_draw.c',
106 'a3xx/fd3_draw.h',
107 'a3xx/fd3_emit.c',
108 'a3xx/fd3_emit.h',
109 'a3xx/fd3_format.c',
110 'a3xx/fd3_format.h',
111 'a3xx/fd3_gmem.c',
112 'a3xx/fd3_gmem.h',
113 'a3xx/fd3_program.c',
114 'a3xx/fd3_program.h',
115 'a3xx/fd3_query.c',
116 'a3xx/fd3_query.h',
117 'a3xx/fd3_rasterizer.c',
118 'a3xx/fd3_rasterizer.h',
119 'a3xx/fd3_screen.c',
120 'a3xx/fd3_screen.h',
121 'a3xx/fd3_texture.c',
122 'a3xx/fd3_texture.h',
123 'a3xx/fd3_zsa.c',
124 'a3xx/fd3_zsa.h',
125 'a4xx/a4xx.xml.h',
126 'a4xx/fd4_blend.c',
127 'a4xx/fd4_blend.h',
128 'a4xx/fd4_context.c',
129 'a4xx/fd4_context.h',
130 'a4xx/fd4_draw.c',
131 'a4xx/fd4_draw.h',
132 'a4xx/fd4_emit.c',
133 'a4xx/fd4_emit.h',
134 'a4xx/fd4_format.c',
135 'a4xx/fd4_format.h',
136 'a4xx/fd4_gmem.c',
137 'a4xx/fd4_gmem.h',
138 'a4xx/fd4_program.c',
139 'a4xx/fd4_program.h',
140 'a4xx/fd4_query.c',
141 'a4xx/fd4_query.h',
142 'a4xx/fd4_rasterizer.c',
143 'a4xx/fd4_rasterizer.h',
144 'a4xx/fd4_screen.c',
145 'a4xx/fd4_screen.h',
146 'a4xx/fd4_texture.c',
147 'a4xx/fd4_texture.h',
148 'a4xx/fd4_zsa.c',
149 'a4xx/fd4_zsa.h',
150 'a5xx/a5xx.xml.h',
151 'a5xx/fd5_blend.c',
152 'a5xx/fd5_blend.h',
153 'a5xx/fd5_blitter.c',
154 'a5xx/fd5_blitter.h',
155 'a5xx/fd5_compute.c',
156 'a5xx/fd5_compute.h',
157 'a5xx/fd5_context.c',
158 'a5xx/fd5_context.h',
159 'a5xx/fd5_draw.c',
160 'a5xx/fd5_draw.h',
161 'a5xx/fd5_emit.c',
162 'a5xx/fd5_emit.h',
163 'a5xx/fd5_format.c',
164 'a5xx/fd5_format.h',
165 'a5xx/fd5_gmem.c',
166 'a5xx/fd5_gmem.h',
167 'a5xx/fd5_image.c',
168 'a5xx/fd5_image.h',
169 'a5xx/fd5_program.c',
170 'a5xx/fd5_program.h',
171 'a5xx/fd5_query.c',
172 'a5xx/fd5_query.h',
173 'a5xx/fd5_rasterizer.c',
174 'a5xx/fd5_rasterizer.h',
175 'a5xx/fd5_screen.c',
176 'a5xx/fd5_screen.h',
177 'a5xx/fd5_texture.c',
178 'a5xx/fd5_texture.h',
179 'a5xx/fd5_zsa.c',
180 'a5xx/fd5_zsa.h',
181 'ir3/disasm-a3xx.c',
182 'ir3/instr-a3xx.h',
183 'ir3/ir3.c',
184 'ir3/ir3_compiler_nir.c',
185 'ir3/ir3_compiler.c',
186 'ir3/ir3_compiler.h',
187 'ir3/ir3_cp.c',
188 'ir3/ir3_depth.c',
189 'ir3/ir3_group.c',
190 'ir3/ir3.h',
191 'ir3/ir3_legalize.c',
192 'ir3/ir3_nir.c',
193 'ir3/ir3_nir.h',
194 'ir3/ir3_nir_lower_if_else.c',
195 'ir3/ir3_nir_lower_tg4_to_tex.c',
196 'ir3/ir3_print.c',
197 'ir3/ir3_ra.c',
198 'ir3/ir3_sched.c',
199 'ir3/ir3_shader.c',
200 'ir3/ir3_shader.h',
201 )
202
203 freedreno_includes = [
204 inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_nir,
205 include_directories('ir3')
206 ]
207
208 freedreno_c_args = []
209 if cc.has_argument('-Wpacked-bitfield-compat')
210 freedreno_c_args += '-Wno-packed-bitfield-compat'
211 endif
212
213 freedreno_cpp_args = []
214 if cpp.has_argument('-Wpacked-bitfield-compat')
215 freedreno_cpp_args += '-Wno-packed-bitfield-compat'
216 endif
217
218 libfreedreno = static_library(
219 'freedreno',
220 [files_libfreedreno, ir3_nir_trig_c, nir_opcodes_h],
221 include_directories : freedreno_includes,
222 c_args : [freedreno_c_args, c_vis_args],
223 cpp_args : [freedreno_cpp_args, cpp_vis_args],
224 dependencies : [dep_libdrm, dep_libdrm_freedreno],
225 )
226
227 driver_freedreno = declare_dependency(
228 compile_args : '-DGALLIUM_FREEDRENO',
229 link_with : [libfreedrenowinsys, libfreedreno],
230 )
231
232 ir3_compiler = executable(
233 'ir3_compiler',
234 'ir3/ir3_cmdline.c',
235 include_directories : freedreno_includes,
236 dependencies : [
237 dep_libdrm,
238 dep_libdrm_freedreno,
239 dep_thread,
240 dep_lmsensors,
241 ],
242 link_with : [
243 libfreedreno,
244 libgallium,
245 libnir,
246 libglsl_standalone,
247 libmesa_util,
248 ],
249 build_by_default : true,
250 )