xref: /aosp_15_r20/external/mesa3d/src/gallium/targets/dril/meson.build (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1# Copyright © 2017 Dylan Baker
2# Copyright © 2018 Intel Corporation
3
4# Permission is hereby granted, free of charge, to any person obtaining a copy
5# of this software and associated documentation files (the "Software"), to deal
6# in the Software without restriction, including without limitation the rights
7# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8# copies of the Software, and to permit persons to whom the Software is
9# furnished to do so, subject to the following conditions:
10
11# The above copyright notice and this permission notice shall be included in
12# all copies or substantial portions of the Software.
13
14# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20# SOFTWARE.
21
22# TODO: support non-static targets
23# Static targets are always enabled in autotools (unless you modify
24# configure.ac)
25
26dril_c_args = []
27dril_ld_args = []
28dril_link_depends = []
29dril_drivers = []
30
31dri_sym = configure_file(input : 'dri.sym.in', output : 'dri.sym', configuration : sym_config)
32
33if with_ld_version_script
34  dril_ld_args += ['-Wl,--version-script', join_paths(meson.current_build_dir(), 'dri.sym')]
35  dril_link_depends += dri_sym
36endif
37if with_ld_dynamic_list
38  dril_ld_args += ['-Wl,--dynamic-list', join_paths(meson.current_source_dir(), '../dri.dyn')]
39  dril_link_depends += files('../dri.dyn')
40endif
41
42dril_dri = shared_library(
43  'dril_dri',
44  files('dril_target.c'),
45  include_directories : [
46    inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_drivers,
47    inc_gallium_winsys,
48  ],
49  gnu_symbol_visibility : 'hidden',
50  link_args : [ld_args_build_id, ld_args_gc_sections, dril_ld_args],
51  link_depends : dril_link_depends,
52  link_with : [
53    libgallium,
54    libgbm,
55  ],
56  dependencies : [
57    idep_mesautil,
58  ],
59  # Will be deleted during installation, see install_megadrivers.py
60  install : true,
61  install_dir : dri_drivers_path,
62  name_suffix : 'so',
63)
64
65foreach d : [[with_gallium_kmsro, [
66               'armada-drm_dri.so',
67               'exynos_dri.so',
68               'gm12u320_dri.so',
69               'hdlcd_dri.so',
70               'hx8357d_dri.so',
71               'ili9163_dri.so',
72               'ili9225_dri.so',
73               'ili9341_dri.so',
74               'ili9486_dri.so',
75               'imx-drm_dri.so',
76               'imx-dcss_dri.so',
77               'imx-lcdif_dri.so',
78               'ingenic-drm_dri.so',
79               'kirin_dri.so',
80               'komeda_dri.so',
81               'mali-dp_dri.so',
82               'mcde_dri.so',
83               'mediatek_dri.so',
84               'meson_dri.so',
85               'mi0283qt_dri.so',
86               'mxsfb-drm_dri.so',
87               'panel-mipi-dbi_dri.so',
88               'pl111_dri.so',
89               'rcar-du_dri.so',
90               'repaper_dri.so',
91               'rockchip_dri.so',
92               'rzg2l-du_dri.so',
93               'ssd130x_dri.so',
94               'st7586_dri.so',
95               'st7735r_dri.so',
96               'sti_dri.so',
97               'stm_dri.so',
98               'sun4i-drm_dri.so',
99               'udl_dri.so',
100               'vkms_dri.so',
101               'zynqmp-dpsub_dri.so',
102             ]],
103             [with_gallium_radeonsi, 'radeonsi_dri.so'],
104             [with_gallium_nouveau, 'nouveau_dri.so'],
105             [with_gallium_freedreno, ['msm_dri.so', 'kgsl_dri.so']],
106             [with_gallium_swrast, 'swrast_dri.so'],
107             [with_gallium_swrast and with_gallium_drisw_kms, 'kms_swrast_dri.so'],
108             [with_gallium_v3d, 'v3d_dri.so'],
109             [with_gallium_vc4, 'vc4_dri.so'],
110             [with_gallium_panfrost, ['panfrost_dri.so', 'panthor_dri.so']],
111             [with_gallium_etnaviv, 'etnaviv_dri.so'],
112             [with_gallium_tegra, 'tegra_dri.so'],
113             [with_gallium_crocus, 'crocus_dri.so'],
114             [with_gallium_iris, 'iris_dri.so'],
115             [with_gallium_i915, 'i915_dri.so'],
116             [with_gallium_r300, 'r300_dri.so'],
117             [with_gallium_r600, 'r600_dri.so'],
118             [with_gallium_svga, 'vmwgfx_dri.so'],
119             [with_gallium_virgl or
120               (with_gallium_freedreno and freedreno_kmds.contains('virtio')),
121               'virtio_gpu_dri.so'],
122             [with_gallium_lima, 'lima_dri.so'],
123             [with_gallium_d3d12, 'd3d12_dri.so'],
124             [with_gallium_zink, 'zink_dri.so'],
125             [with_gallium_asahi, 'asahi_dri.so']]
126  if d[0]
127    dril_drivers += d[1]
128  endif
129endforeach
130
131# This only works on Unix-like oses, which is probably fine for dri
132prog_ln = find_program('ln', required : false)
133if prog_ln.found()
134  foreach d : dril_drivers
135    custom_target(
136      d,
137      output : d,
138      command : [prog_ln, '-sf', 'libdril_dri.so', '@OUTPUT@'],
139      build_by_default : true,
140    )
141  endforeach
142endif
143
144if dril_drivers.length() > 0
145  meson.add_install_script(
146    install_megadrivers_py.full_path(),
147    dril_dri.full_path(),
148    dri_drivers_path,
149    dril_drivers,
150    install_tag : 'runtime',
151  )
152endif
153