8745ee6f3032c13a646ca8be6f1c7d937f01e350
[platform/upstream/mesa.git] / src / gallium / auxiliary / meson.build
1 # Copyright © 2017 Dylan Baker
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 files_libgallium = files(
22   'cso_cache/cso_cache.c',
23   'cso_cache/cso_cache.h',
24   'cso_cache/cso_context.c',
25   'cso_cache/cso_context.h',
26   'cso_cache/cso_hash.c',
27   'cso_cache/cso_hash.h',
28   'draw/draw_cliptest_tmp.h',
29   'draw/draw_context.c',
30   'draw/draw_context.h',
31   'draw/draw_decompose_tmp.h',
32   'draw/draw_fs.c',
33   'draw/draw_fs.h',
34   'draw/draw_gs.c',
35   'draw/draw_gs.h',
36   'draw/draw_gs_tmp.h',
37   'draw/draw_pipe_aaline.c',
38   'draw/draw_pipe_aapoint.c',
39   'draw/draw_pipe.c',
40   'draw/draw_pipe.h',
41   'draw/draw_pipe_clip.c',
42   'draw/draw_pipe_cull.c',
43   'draw/draw_pipe_flatshade.c',
44   'draw/draw_pipe_offset.c',
45   'draw/draw_pipe_pstipple.c',
46   'draw/draw_pipe_stipple.c',
47   'draw/draw_pipe_twoside.c',
48   'draw/draw_pipe_unfilled.c',
49   'draw/draw_pipe_user_cull.c',
50   'draw/draw_pipe_util.c',
51   'draw/draw_pipe_validate.c',
52   'draw/draw_pipe_vbuf.c',
53   'draw/draw_pipe_wide_line.c',
54   'draw/draw_pipe_wide_point.c',
55   'draw/draw_prim_assembler.c',
56   'draw/draw_prim_assembler.h',
57   'draw/draw_prim_assembler_tmp.h',
58   'draw/draw_private.h',
59   'draw/draw_pt.c',
60   'draw/draw_pt_decompose.h',
61   'draw/draw_pt_emit.c',
62   'draw/draw_pt_fetch.c',
63   'draw/draw_pt_fetch_shade_emit.c',
64   'draw/draw_pt_fetch_shade_pipeline.c',
65   'draw/draw_pt.h',
66   'draw/draw_pt_post_vs.c',
67   'draw/draw_pt_so_emit.c',
68   'draw/draw_pt_util.c',
69   'draw/draw_pt_vsplit.c',
70   'draw/draw_pt_vsplit_tmp.h',
71   'draw/draw_so_emit_tmp.h',
72   'draw/draw_split_tmp.h',
73   'draw/draw_tess.c',
74   'draw/draw_tess.h',
75   'draw/draw_vbuf.h',
76   'draw/draw_vertex.c',
77   'draw/draw_vertex.h',
78   'draw/draw_vs.c',
79   'draw/draw_vs_exec.c',
80   'draw/draw_vs.h',
81   'draw/draw_vs_variant.c',
82   'driver_ddebug/dd_context.c',
83   'driver_ddebug/dd_draw.c',
84   'driver_ddebug/dd_pipe.h',
85   'driver_ddebug/dd_public.h',
86   'driver_ddebug/dd_screen.c',
87   'driver_ddebug/dd_util.h',
88   'driver_noop/noop_pipe.c',
89   'driver_noop/noop_public.h',
90   'driver_noop/noop_state.c',
91   'driver_trace/tr_context.c',
92   'driver_trace/tr_context.h',
93   'driver_trace/tr_dump.c',
94   'driver_trace/tr_dump_defines.h',
95   'driver_trace/tr_dump.h',
96   'driver_trace/tr_dump_state.c',
97   'driver_trace/tr_dump_state.h',
98   'driver_trace/tr_public.h',
99   'driver_trace/tr_screen.c',
100   'driver_trace/tr_screen.h',
101   'driver_trace/tr_texture.c',
102   'driver_trace/tr_texture.h',
103   'hud/font.c',
104   'hud/font.h',
105   'hud/hud_context.c',
106   'hud/hud_context.h',
107   'hud/hud_cpu.c',
108   'hud/hud_nic.c',
109   'hud/hud_cpufreq.c',
110   'hud/hud_diskstat.c',
111   'hud/hud_sensors_temp.c',
112   'hud/hud_driver_query.c',
113   'hud/hud_fps.c',
114   'hud/hud_private.h',
115   'os/os_mman.h',
116   'os/os_process.c',
117   'os/os_process.h',
118   'os/os_thread.h',
119   'pipebuffer/pb_buffer_fenced.c',
120   'pipebuffer/pb_buffer_fenced.h',
121   'pipebuffer/pb_buffer.h',
122   'pipebuffer/pb_bufmgr_cache.c',
123   'pipebuffer/pb_bufmgr_debug.c',
124   'pipebuffer/pb_bufmgr.h',
125   'pipebuffer/pb_bufmgr_mm.c',
126   'pipebuffer/pb_bufmgr_slab.c',
127   'pipebuffer/pb_cache.c',
128   'pipebuffer/pb_cache.h',
129   'pipebuffer/pb_slab.c',
130   'pipebuffer/pb_slab.h',
131   'pipebuffer/pb_validate.c',
132   'pipebuffer/pb_validate.h',
133   'postprocess/filters.h',
134   'postprocess/postprocess.h',
135   'postprocess/pp_celshade.c',
136   'postprocess/pp_celshade.h',
137   'postprocess/pp_colors.c',
138   'postprocess/pp_colors.h',
139   'postprocess/pp_filters.h',
140   'postprocess/pp_init.c',
141   'postprocess/pp_mlaa_areamap.h',
142   'postprocess/pp_mlaa.c',
143   'postprocess/pp_mlaa.h',
144   'postprocess/pp_private.h',
145   'postprocess/pp_program.c',
146   'postprocess/pp_run.c',
147   'rtasm/rtasm_execmem.c',
148   'rtasm/rtasm_execmem.h',
149   'rtasm/rtasm_x86sse.c',
150   'rtasm/rtasm_x86sse.h',
151   'tgsi/tgsi_aa_point.c',
152   'tgsi/tgsi_aa_point.h',
153   'tgsi/tgsi_build.c',
154   'tgsi/tgsi_build.h',
155   'tgsi/tgsi_dump.c',
156   'tgsi/tgsi_dump.h',
157   'tgsi/tgsi_dynamic_indexing.c',
158   'tgsi/tgsi_exec.c',
159   'tgsi/tgsi_exec.h',
160   'tgsi/tgsi_from_mesa.c',
161   'tgsi/tgsi_from_mesa.h',
162   'tgsi/tgsi_info.c',
163   'tgsi/tgsi_info.h',
164   'tgsi/tgsi_info_opcodes.h',
165   'tgsi/tgsi_iterate.c',
166   'tgsi/tgsi_iterate.h',
167   'tgsi/tgsi_lowering.c',
168   'tgsi/tgsi_lowering.h',
169   'tgsi/tgsi_opcode_tmp.h',
170   'tgsi/tgsi_parse.c',
171   'tgsi/tgsi_parse.h',
172   'tgsi/tgsi_point_sprite.c',
173   'tgsi/tgsi_point_sprite.h',
174   'tgsi/tgsi_sanity.c',
175   'tgsi/tgsi_sanity.h',
176   'tgsi/tgsi_scan.c',
177   'tgsi/tgsi_scan.h',
178   'tgsi/tgsi_strings.c',
179   'tgsi/tgsi_strings.h',
180   'tgsi/tgsi_text.c',
181   'tgsi/tgsi_text.h',
182   'tgsi/tgsi_transform.c',
183   'tgsi/tgsi_transform.h',
184   'tgsi/tgsi_two_side.c',
185   'tgsi/tgsi_two_side.h',
186   'tgsi/tgsi_ureg.c',
187   'tgsi/tgsi_ureg.h',
188   'tgsi/tgsi_util.c',
189   'tgsi/tgsi_util.h',
190   'tgsi/tgsi_vpos.c',
191   'translate/translate.c',
192   'translate/translate.h',
193   'translate/translate_cache.c',
194   'translate/translate_cache.h',
195   'translate/translate_generic.c',
196   'translate/translate_sse.c',
197   'util/dbghelp.h',
198   'util/u_async_debug.h',
199   'util/u_async_debug.c',
200   'util/u_bitcast.h',
201   'util/u_bitmask.c',
202   'util/u_bitmask.h',
203   'util/u_blend.h',
204   'util/u_blitter.c',
205   'util/u_blitter.h',
206   'util/u_box.h',
207   'util/u_cache.c',
208   'util/u_cache.h',
209   'util/u_compute.c',
210   'util/u_compute.h',
211   'util/u_debug_cb.h',
212   'util/u_debug_flush.c',
213   'util/u_debug_flush.h',
214   'util/u_debug_image.c',
215   'util/u_debug_image.h',
216   'util/u_dirty_flags.h',
217   'util/u_dirty_surfaces.h',
218   'util/u_draw.c',
219   'util/u_draw.h',
220   'util/u_draw_quad.c',
221   'util/u_draw_quad.h',
222   'util/u_driconf.c',
223   'util/u_driconf.h',
224   'util/u_dual_blend.h',
225   'util/u_dump_defines.c',
226   'util/u_dump.h',
227   'util/u_dump_state.c',
228   'util/u_framebuffer.c',
229   'util/u_framebuffer.h',
230   'util/u_gen_mipmap.c',
231   'util/u_gen_mipmap.h',
232   'util/u_handle_table.c',
233   'util/u_handle_table.h',
234   'util/u_helpers.c',
235   'util/u_helpers.h',
236   'util/u_index_modify.c',
237   'util/u_index_modify.h',
238   'util/u_inlines.h',
239   'util/u_linear.c',
240   'util/u_linear.h',
241   'util/u_live_shader_cache.c',
242   'util/u_live_shader_cache.h',
243   'util/u_log.c',
244   'util/u_log.h',
245   'util/u_pack_color.h',
246   'util/u_prim.h',
247   'util/u_prim.c',
248   'util/u_prim_restart.c',
249   'util/u_prim_restart.h',
250   'util/u_pstipple.c',
251   'util/u_pstipple.h',
252   'util/u_pwr8.h',
253   'util/u_range.h',
254   'util/u_rect.h',
255   'util/u_resource.c',
256   'util/u_resource.h',
257   'util/u_sampler.c',
258   'util/u_sampler.h',
259   'util/u_screen.c',
260   'util/u_screen.h',
261   'util/u_simple_shaders.c',
262   'util/u_simple_shaders.h',
263   'util/u_split_draw.c',
264   'util/u_split_draw.h',
265   'util/u_split_prim.h',
266   'util/u_sse.h',
267   'util/u_suballoc.c',
268   'util/u_suballoc.h',
269   'util/u_surface.c',
270   'util/u_surface.h',
271   'util/u_tests.c',
272   'util/u_tests.h',
273   'util/u_texture.c',
274   'util/u_texture.h',
275   'util/u_tile.c',
276   'util/u_tile.h',
277   'util/u_transfer.c',
278   'util/u_transfer.h',
279   'util/u_transfer_helper.c',
280   'util/u_transfer_helper.h',
281   'util/u_threaded_context.c',
282   'util/u_threaded_context.h',
283   'util/u_threaded_context_calls.h',
284   'util/u_trace_gallium.c',
285   'util/u_trace_gallium.h',
286   'util/u_upload_mgr.c',
287   'util/u_upload_mgr.h',
288   'util/u_vbuf.c',
289   'util/u_vbuf.h',
290   'util/u_vertex_state_cache.c',
291   'util/u_vertex_state_cache.h',
292   'util/u_video.h',
293   'util/u_viewport.h',
294   'nir/tgsi_to_nir.c',
295   'nir/tgsi_to_nir.h',
296   'nir/nir_to_tgsi.c',
297   'nir/nir_to_tgsi.h',
298   'nir/nir_draw_helpers.c',
299   'nir/nir_draw_helpers.h',
300   'nir/nir_helpers.c',
301   'nir/nir_helpers.h',
302 )
303
304 if dep_libdrm.found()
305   files_libgallium += files(
306     'renderonly/renderonly.c',
307     'renderonly/renderonly.h',
308   )
309 endif
310
311 if draw_with_llvm
312   files_libgallium += files(
313     'gallivm/lp_bld_arit.c',
314     'gallivm/lp_bld_arit.h',
315     'gallivm/lp_bld_arit_overflow.c',
316     'gallivm/lp_bld_arit_overflow.h',
317     'gallivm/lp_bld_assert.c',
318     'gallivm/lp_bld_assert.h',
319     'gallivm/lp_bld_bitarit.c',
320     'gallivm/lp_bld_bitarit.h',
321     'gallivm/lp_bld_const.c',
322     'gallivm/lp_bld_const.h',
323     'gallivm/lp_bld_conv.c',
324     'gallivm/lp_bld_conv.h',
325     'gallivm/lp_bld_coro.c',
326     'gallivm/lp_bld_coro.h',
327     'gallivm/lp_bld_debug.cpp',
328     'gallivm/lp_bld_debug.h',
329     'gallivm/lp_bld_flow.c',
330     'gallivm/lp_bld_flow.h',
331     'gallivm/lp_bld_format_aos_array.c',
332     'gallivm/lp_bld_format_aos.c',
333     'gallivm/lp_bld_format_float.c',
334     'gallivm/lp_bld_format_s3tc.c',
335     'gallivm/lp_bld_format.c',
336     'gallivm/lp_bld_format.h',
337     'gallivm/lp_bld_format_soa.c',
338     'gallivm/lp_bld_format_srgb.c',
339     'gallivm/lp_bld_format_yuv.c',
340     'gallivm/lp_bld_gather.c',
341     'gallivm/lp_bld_gather.h',
342     'gallivm/lp_bld.h',
343     'gallivm/lp_bld_init.c',
344     'gallivm/lp_bld_init.h',
345     'gallivm/lp_bld_intr.c',
346     'gallivm/lp_bld_intr.h',
347     'gallivm/lp_bld_ir_common.c',
348     'gallivm/lp_bld_ir_common.h',
349     'gallivm/lp_bld_jit_types.h',
350     'gallivm/lp_bld_jit_types.c',
351     'gallivm/lp_bld_limits.h',
352     'gallivm/lp_bld_logic.c',
353     'gallivm/lp_bld_logic.h',
354     'gallivm/lp_bld_misc.cpp',
355     'gallivm/lp_bld_misc.h',
356     'gallivm/lp_bld_nir.h',
357     'gallivm/lp_bld_nir.c',
358     'gallivm/lp_bld_nir_aos.c',
359     'gallivm/lp_bld_nir_soa.c',
360     'gallivm/lp_bld_pack.c',
361     'gallivm/lp_bld_pack.h',
362     'gallivm/lp_bld_printf.c',
363     'gallivm/lp_bld_printf.h',
364     'gallivm/lp_bld_quad.c',
365     'gallivm/lp_bld_quad.h',
366     'gallivm/lp_bld_sample_aos.c',
367     'gallivm/lp_bld_sample_aos.h',
368     'gallivm/lp_bld_sample.c',
369     'gallivm/lp_bld_sample.h',
370     'gallivm/lp_bld_sample_soa.c',
371     'gallivm/lp_bld_struct.c',
372     'gallivm/lp_bld_struct.h',
373     'gallivm/lp_bld_swizzle.c',
374     'gallivm/lp_bld_swizzle.h',
375     'gallivm/lp_bld_tgsi_action.c',
376     'gallivm/lp_bld_tgsi_action.h',
377     'gallivm/lp_bld_tgsi_aos.c',
378     'gallivm/lp_bld_tgsi.c',
379     'gallivm/lp_bld_tgsi.h',
380     'gallivm/lp_bld_tgsi_info.c',
381     'gallivm/lp_bld_tgsi_soa.c',
382     'gallivm/lp_bld_type.c',
383     'gallivm/lp_bld_type.h',
384     'draw/draw_llvm.c',
385     'draw/draw_llvm.h',
386     'draw/draw_llvm_sample.c',
387     'draw/draw_pt_fetch_shade_pipeline_llvm.c',
388     'draw/draw_vs_llvm.c',
389     'tessellator/tessellator.cpp',
390     'tessellator/tessellator.hpp',
391     'tessellator/p_tessellator.cpp',
392     'tessellator/p_tessellator.h',
393     'nir/nir_to_tgsi_info.c',
394     'nir/nir_to_tgsi_info.h',
395   )
396 endif
397
398 files_libgalliumvl = files(
399   'vl/vl_bicubic_filter.c',
400   'vl/vl_bicubic_filter.h',
401   'vl/vl_codec.c',
402   'vl/vl_codec.h',
403   'vl/vl_compositor.c',
404   'vl/vl_compositor.h',
405   'vl/vl_compositor_gfx.c',
406   'vl/vl_compositor_gfx.h',
407   'vl/vl_compositor_cs.c',
408   'vl/vl_compositor_cs.h',
409   'vl/vl_csc.c',
410   'vl/vl_csc.h',
411   'vl/vl_decoder.c',
412   'vl/vl_decoder.h',
413   'vl/vl_defines.h',
414   'vl/vl_deint_filter.c',
415   'vl/vl_deint_filter.h',
416   'vl/vl_idct.c',
417   'vl/vl_idct.h',
418   'vl/vl_matrix_filter.c',
419   'vl/vl_matrix_filter.h',
420   'vl/vl_mc.c',
421   'vl/vl_mc.h',
422   'vl/vl_median_filter.c',
423   'vl/vl_median_filter.h',
424   'vl/vl_mpeg12_bitstream.c',
425   'vl/vl_mpeg12_bitstream.h',
426   'vl/vl_mpeg12_decoder.c',
427   'vl/vl_mpeg12_decoder.h',
428   'vl/vl_types.h',
429   'vl/vl_vertex_buffers.c',
430   'vl/vl_vertex_buffers.h',
431   'vl/vl_video_buffer.c',
432   'vl/vl_video_buffer.h',
433   'vl/vl_zscan.c',
434   'vl/vl_zscan.h',
435   'vl/vl_probs_table.h',
436 )
437
438 vlwinsys_deps = []
439 files_libgalliumvlwinsys = files('vl/vl_winsys.h')
440 if host_machine.system() == 'windows'
441   files_libgalliumvlwinsys += files('vl/vl_winsys_win32.c')
442 else
443   files_libgalliumvlwinsys += files('vl/vl_winsys_drm.c')
444 endif
445 if with_dri2 and with_platform_x11
446   files_libgalliumvlwinsys += files('vl/vl_winsys_dri.c')
447   if with_dri3
448     vlwinsys_deps += [
449       dep_xcb_sync, dep_xcb_present, dep_xshmfence, dep_xcb_xfixes,
450       dep_xcb_dri3,
451     ]
452     files_libgalliumvlwinsys += files('vl/vl_winsys_dri3.c')
453   endif
454 endif
455
456 if with_glx == 'xlib'
457   files_libgalliumvlwinsys += files('vl/vl_winsys_xlib_swrast.c')
458 elif with_gallium_drisw_kms
459   files_libgalliumvlwinsys += files('vl/vl_winsys_dri_vgem.c')
460 endif
461
462 prog_enums2names = files('driver_trace/enums2names.py')
463 files_libgallium += custom_target(
464   'tr_util.[ch]',
465   input: '../include/pipe/p_defines.h',
466   output: ['tr_util.c', 'tr_util.h'],
467   command: [prog_python, prog_enums2names, '@INPUT@', '-C', '@OUTPUT0@', '-H', '@OUTPUT1@', '-I', 'tr_util.h'],
468   depend_files: prog_enums2names,
469 )
470
471 files_libgallium += custom_target(
472   'u_tracepoints.c',
473   input: 'util/u_tracepoints.py',
474   output: 'u_tracepoints.c',
475   command: [
476     prog_python, '@INPUT@',
477     '-p', join_paths(meson.source_root(), 'src/util/perf/'),
478     '-C', '@OUTPUT@',
479   ],
480   depend_files: u_trace_py,
481 )
482
483 files_u_tracepoints = custom_target(
484   'u_tracepoints.h',
485   input: 'util/u_tracepoints.py',
486   output: 'u_tracepoints.h',
487   command: [
488     prog_python, '@INPUT@',
489     '-p', join_paths(meson.source_root(), 'src/util/perf/'),
490     '-H', '@OUTPUT@',
491   ],
492   depend_files: u_trace_py,
493 )
494
495 files_libgallium += files_u_tracepoints
496
497 idep_u_tracepoints = declare_dependency(
498   sources: files_u_tracepoints,
499 )
500
501 libgallium_extra_c_args = []
502 libgallium = static_library(
503   'gallium',
504   [files_libgallium],
505   include_directories : [
506     inc_loader, inc_gallium, inc_src, inc_include, include_directories('util')
507   ],
508   c_args : [c_msvc_compat_args, libgallium_extra_c_args],
509   cpp_args : [cpp_msvc_compat_args],
510   gnu_symbol_visibility : 'hidden',
511   dependencies : [
512     dep_libdrm, dep_llvm, dep_dl, dep_m, dep_thread, dep_lmsensors, dep_ws2_32,
513     idep_nir, idep_nir_headers, idep_mesautil,
514   ],
515   build_by_default : false
516 )
517
518 libgalliumvl_stub = static_library(
519   'galliumvl_stub',
520   'vl/vl_stubs.c',
521   c_args : [c_msvc_compat_args],
522   cpp_args : [cpp_msvc_compat_args],
523   gnu_symbol_visibility : 'hidden',
524   include_directories: [inc_gallium, inc_include, inc_src],
525   dependencies : idep_mesautil,
526   build_by_default : false,
527 )
528
529 libgalliumvl = static_library(
530   'galliumvl',
531   files_libgalliumvl,
532   c_args : [c_msvc_compat_args],
533   cpp_args : [cpp_msvc_compat_args],
534   gnu_symbol_visibility : 'hidden',
535   include_directories : [inc_gallium, inc_include, inc_src],
536   dependencies : idep_mesautil,
537   build_by_default : false,
538 )
539
540 # XXX: The dependencies here may be off...
541 libgalliumvlwinsys = static_library(
542   'galliumvlwinsys',
543   files_libgalliumvlwinsys,
544   include_directories : [inc_gallium, inc_include, inc_loader, inc_src],
545   dependencies : [dep_libdrm, vlwinsys_deps, idep_mesautil],
546   build_by_default : false,
547 )