meson.build revision 01e04c3f
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
21ir3_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 : [
26    prog_python, '@INPUT@',
27    '-p', join_paths(meson.source_root(), 'src/compiler/nir/'),
28  ],
29  capture : true,
30  depend_files : nir_algebraic_py,
31)
32
33files_libfreedreno = files(
34  'adreno_common.xml.h',
35  'adreno_pm4.xml.h',
36  'disasm.h',
37  'freedreno_batch.c',
38  'freedreno_batch.h',
39  'freedreno_batch_cache.c',
40  'freedreno_batch_cache.h',
41  'freedreno_blitter.c',
42  'freedreno_blitter.h',
43  'freedreno_context.c',
44  'freedreno_context.h',
45  'freedreno_draw.c',
46  'freedreno_draw.h',
47  'freedreno_fence.c',
48  'freedreno_fence.h',
49  'freedreno_gmem.c',
50  'freedreno_gmem.h',
51  'freedreno_perfcntr.h',
52  'freedreno_program.c',
53  'freedreno_program.h',
54  'freedreno_query.c',
55  'freedreno_query.h',
56  'freedreno_query_acc.c',
57  'freedreno_query_acc.h',
58  'freedreno_query_hw.c',
59  'freedreno_query_hw.h',
60  'freedreno_query_sw.c',
61  'freedreno_query_sw.h',
62  'freedreno_resource.c',
63  'freedreno_resource.h',
64  'freedreno_screen.c',
65  'freedreno_screen.h',
66  'freedreno_state.c',
67  'freedreno_state.h',
68  'freedreno_surface.c',
69  'freedreno_surface.h',
70  'freedreno_texture.c',
71  'freedreno_texture.h',
72  'freedreno_util.c',
73  'freedreno_util.h',
74  'drm/freedreno_bo.c',
75  'drm/freedreno_bo_cache.c',
76  'drm/freedreno_device.c',
77  'drm/freedreno_drmif.h',
78  'drm/freedreno_pipe.c',
79  'drm/freedreno_priv.h',
80  'drm/freedreno_ringbuffer.c',
81  'drm/freedreno_ringbuffer.h',
82  'drm/msm_bo.c',
83  'drm/msm_device.c',
84  'drm/msm_drm.h',
85  'drm/msm_pipe.c',
86  'drm/msm_priv.h',
87  'drm/msm_ringbuffer.c',
88  'drm/msm_ringbuffer_sp.c',
89  'a2xx/a2xx.xml.h',
90  'a2xx/disasm-a2xx.c',
91  'a2xx/fd2_blend.c',
92  'a2xx/fd2_blend.h',
93  'a2xx/fd2_compiler.c',
94  'a2xx/fd2_compiler.h',
95  'a2xx/fd2_context.c',
96  'a2xx/fd2_context.h',
97  'a2xx/fd2_draw.c',
98  'a2xx/fd2_draw.h',
99  'a2xx/fd2_emit.c',
100  'a2xx/fd2_emit.h',
101  'a2xx/fd2_gmem.c',
102  'a2xx/fd2_gmem.h',
103  'a2xx/fd2_program.c',
104  'a2xx/fd2_program.h',
105  'a2xx/fd2_rasterizer.c',
106  'a2xx/fd2_rasterizer.h',
107  'a2xx/fd2_screen.c',
108  'a2xx/fd2_screen.h',
109  'a2xx/fd2_texture.c',
110  'a2xx/fd2_texture.h',
111  'a2xx/fd2_util.c',
112  'a2xx/fd2_util.h',
113  'a2xx/fd2_zsa.c',
114  'a2xx/fd2_zsa.h',
115  'a2xx/instr-a2xx.h',
116  'a2xx/ir-a2xx.c',
117  'a2xx/ir-a2xx.h',
118  'a3xx/a3xx.xml.h',
119  'a3xx/fd3_blend.c',
120  'a3xx/fd3_blend.h',
121  'a3xx/fd3_context.c',
122  'a3xx/fd3_context.h',
123  'a3xx/fd3_draw.c',
124  'a3xx/fd3_draw.h',
125  'a3xx/fd3_emit.c',
126  'a3xx/fd3_emit.h',
127  'a3xx/fd3_format.c',
128  'a3xx/fd3_format.h',
129  'a3xx/fd3_gmem.c',
130  'a3xx/fd3_gmem.h',
131  'a3xx/fd3_program.c',
132  'a3xx/fd3_program.h',
133  'a3xx/fd3_query.c',
134  'a3xx/fd3_query.h',
135  'a3xx/fd3_rasterizer.c',
136  'a3xx/fd3_rasterizer.h',
137  'a3xx/fd3_screen.c',
138  'a3xx/fd3_screen.h',
139  'a3xx/fd3_texture.c',
140  'a3xx/fd3_texture.h',
141  'a3xx/fd3_zsa.c',
142  'a3xx/fd3_zsa.h',
143  'a4xx/a4xx.xml.h',
144  'a4xx/fd4_blend.c',
145  'a4xx/fd4_blend.h',
146  'a4xx/fd4_context.c',
147  'a4xx/fd4_context.h',
148  'a4xx/fd4_draw.c',
149  'a4xx/fd4_draw.h',
150  'a4xx/fd4_emit.c',
151  'a4xx/fd4_emit.h',
152  'a4xx/fd4_format.c',
153  'a4xx/fd4_format.h',
154  'a4xx/fd4_gmem.c',
155  'a4xx/fd4_gmem.h',
156  'a4xx/fd4_program.c',
157  'a4xx/fd4_program.h',
158  'a4xx/fd4_query.c',
159  'a4xx/fd4_query.h',
160  'a4xx/fd4_rasterizer.c',
161  'a4xx/fd4_rasterizer.h',
162  'a4xx/fd4_screen.c',
163  'a4xx/fd4_screen.h',
164  'a4xx/fd4_texture.c',
165  'a4xx/fd4_texture.h',
166  'a4xx/fd4_zsa.c',
167  'a4xx/fd4_zsa.h',
168  'a5xx/a5xx.xml.h',
169  'a5xx/fd5_blend.c',
170  'a5xx/fd5_blend.h',
171  'a5xx/fd5_blitter.c',
172  'a5xx/fd5_blitter.h',
173  'a5xx/fd5_compute.c',
174  'a5xx/fd5_compute.h',
175  'a5xx/fd5_context.c',
176  'a5xx/fd5_context.h',
177  'a5xx/fd5_draw.c',
178  'a5xx/fd5_draw.h',
179  'a5xx/fd5_emit.c',
180  'a5xx/fd5_emit.h',
181  'a5xx/fd5_format.c',
182  'a5xx/fd5_format.h',
183  'a5xx/fd5_gmem.c',
184  'a5xx/fd5_gmem.h',
185  'a5xx/fd5_image.c',
186  'a5xx/fd5_image.h',
187  'a5xx/fd5_perfcntr.c',
188  'a5xx/fd5_program.c',
189  'a5xx/fd5_program.h',
190  'a5xx/fd5_query.c',
191  'a5xx/fd5_query.h',
192  'a5xx/fd5_rasterizer.c',
193  'a5xx/fd5_rasterizer.h',
194  'a5xx/fd5_resource.c',
195  'a5xx/fd5_resource.h',
196  'a5xx/fd5_screen.c',
197  'a5xx/fd5_screen.h',
198  'a5xx/fd5_texture.c',
199  'a5xx/fd5_texture.h',
200  'a5xx/fd5_zsa.c',
201  'a5xx/fd5_zsa.h',
202  'a6xx/a6xx.xml.h',
203  'a6xx/fd6_blend.c',
204  'a6xx/fd6_blend.h',
205  'a6xx/fd6_blitter.c',
206  'a6xx/fd6_blitter.h',
207  'a6xx/fd6_context.c',
208  'a6xx/fd6_context.h',
209  'a6xx/fd6_draw.c',
210  'a6xx/fd6_draw.h',
211  'a6xx/fd6_emit.c',
212  'a6xx/fd6_emit.h',
213  'a6xx/fd6_format.c',
214  'a6xx/fd6_format.h',
215  'a6xx/fd6_gmem.c',
216  'a6xx/fd6_gmem.h',
217  'a6xx/fd6_image.c',
218  'a6xx/fd6_image.h',
219  'a6xx/fd6_program.c',
220  'a6xx/fd6_program.h',
221  'a6xx/fd6_query.c',
222  'a6xx/fd6_query.h',
223  'a6xx/fd6_rasterizer.c',
224  'a6xx/fd6_rasterizer.h',
225  'a6xx/fd6_resource.c',
226  'a6xx/fd6_resource.h',
227  'a6xx/fd6_screen.c',
228  'a6xx/fd6_screen.h',
229  'a6xx/fd6_texture.c',
230  'a6xx/fd6_texture.h',
231  'a6xx/fd6_zsa.c',
232  'a6xx/fd6_zsa.h',
233  'ir3/disasm-a3xx.c',
234  'ir3/instr-a3xx.h',
235  'ir3/ir3.c',
236  'ir3/ir3_cache.c',
237  'ir3/ir3_cache.h',
238  'ir3/ir3_compiler_nir.c',
239  'ir3/ir3_compiler.c',
240  'ir3/ir3_compiler.h',
241  'ir3/ir3_cp.c',
242  'ir3/ir3_depth.c',
243  'ir3/ir3_group.c',
244  'ir3/ir3.h',
245  'ir3/ir3_legalize.c',
246  'ir3/ir3_nir.c',
247  'ir3/ir3_nir.h',
248  'ir3/ir3_nir_lower_tg4_to_tex.c',
249  'ir3/ir3_print.c',
250  'ir3/ir3_ra.c',
251  'ir3/ir3_sched.c',
252  'ir3/ir3_shader.c',
253  'ir3/ir3_shader.h',
254)
255
256freedreno_includes = [
257  inc_src, inc_include, inc_gallium, inc_gallium_aux,
258  include_directories('ir3')
259]
260
261freedreno_c_args = []
262if cc.has_argument('-Wpacked-bitfield-compat')
263  freedreno_c_args += '-Wno-packed-bitfield-compat'
264endif
265
266freedreno_cpp_args = []
267if cpp.has_argument('-Wpacked-bitfield-compat')
268  freedreno_cpp_args += '-Wno-packed-bitfield-compat'
269endif
270
271libfreedreno = static_library(
272  'freedreno',
273  [files_libfreedreno, ir3_nir_trig_c],
274  include_directories : freedreno_includes,
275  c_args : [freedreno_c_args, c_vis_args],
276  cpp_args : [freedreno_cpp_args, cpp_vis_args],
277  dependencies : [
278    dep_libdrm,
279    dep_valgrind,
280    idep_nir_headers
281  ],
282)
283
284driver_freedreno = declare_dependency(
285  compile_args : '-DGALLIUM_FREEDRENO',
286  link_with : [libfreedrenowinsys, libfreedreno],
287  dependencies : idep_nir,
288)
289
290ir3_compiler = executable(
291  'ir3_compiler',
292  'ir3/ir3_cmdline.c',
293  include_directories : freedreno_includes,
294  dependencies : [
295    dep_libdrm,
296    dep_valgrind,
297    dep_thread,
298    idep_nir,
299  ],
300  link_with : [
301    libfreedreno,
302    libgallium,
303    libglsl_standalone,
304    libmesa_util,
305  ],
306  build_by_default : with_tools.contains('freedreno'),
307  install : with_tools.contains('freedreno'),
308)
309