43f7ac2c22cd20f1aebf5ba394b2bfc1aedb3f4e
[mesa.git] / src / gallium / targets / dri / meson.build
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
26 gallium_dri_c_args = []
27 gallium_dri_ld_args = []
28 gallium_dri_link_depends = []
29 gallium_dri_drivers = []
30
31 if with_ld_version_script
32 gallium_dri_ld_args += ['-Wl,--version-script', join_paths(meson.current_source_dir(), 'dri.sym')]
33 gallium_dri_link_depends += files('dri.sym')
34 endif
35 if with_ld_dynamic_list
36 gallium_dri_ld_args += ['-Wl,--dynamic-list', join_paths(meson.current_source_dir(), '../dri-vdpau.dyn')]
37 gallium_dri_link_depends += files('../dri-vdpau.dyn')
38 endif
39
40 libgallium_dri = shared_library(
41 'gallium_dri',
42 [files('target.c'), xmlpool_options_h],
43 include_directories : [
44 inc_common, inc_util, inc_dri_common, inc_gallium_drivers,
45 inc_gallium_winsys, include_directories('../../state_trackers/dri'),
46 ],
47 c_args : [c_vis_args],
48 cpp_args : [cpp_vis_args],
49 link_args : [ld_args_gc_sections, gallium_dri_ld_args],
50 link_depends : gallium_dri_link_depends,
51 link_with : [
52 libmesa_gallium, libdricommon, libmegadriver_stub, libdri, libgalliumvl,
53 libgallium, libglapi, libpipe_loader_static, libws_null, libwsw, libswdri,
54 libswkmsdri,
55 ],
56 dependencies : [
57 dep_selinux, dep_expat, dep_libdrm, dep_llvm, dep_thread,
58 driver_swrast, driver_r300, driver_r600, driver_radeonsi, driver_nouveau,
59 driver_kmsro, driver_v3d, driver_vc4, driver_freedreno, driver_etnaviv,
60 driver_tegra, driver_i915, driver_svga, driver_virgl,
61 driver_swr, driver_panfrost
62 ],
63 )
64
65 foreach d : [[with_gallium_kmsro, [
66 'hx8357d_dri.so',
67 'ili9225_dri.so',
68 'ili9341_dri.so',
69 'imx-drm_dri.so',
70 'meson_dri.so',
71 'mi0283qt_dri.so',
72 'pl111_dri.so',
73 'repaper_dri.so',
74 'rockchip_dri.so',
75 'st7586.so',
76 'st7735r.so',
77 ]],
78 [with_gallium_radeonsi, 'radeonsi_dri.so'],
79 [with_gallium_nouveau, 'nouveau_dri.so'],
80 [with_gallium_freedreno, ['msm_dri.so', 'kgsl_dri.so']],
81 [with_gallium_softpipe or with_gallium_swr, 'swrast_dri.so'],
82 [with_gallium_softpipe and with_gallium_drisw_kms, 'kms_swrast_dri.so'],
83 [with_gallium_v3d, 'v3d_dri.so'],
84 [with_gallium_vc4, 'vc4_dri.so'],
85 [with_gallium_panfrost, 'panfrost_dri.so'],
86 [with_gallium_etnaviv, 'etnaviv_dri.so'],
87 [with_gallium_tegra, 'tegra_dri.so'],
88 [with_gallium_i915, 'i915_dri.so'],
89 [with_gallium_r300, 'r300_dri.so'],
90 [with_gallium_r600, 'r600_dri.so'],
91 [with_gallium_svga, 'vmwgfx_dri.so'],
92 [with_gallium_virgl, 'virtio_gpu_dri.so']]
93 if d[0]
94 gallium_dri_drivers += d[1]
95 endif
96 endforeach
97
98 meson.add_install_script(
99 prog_python.path(),
100 join_paths(meson.source_root(), 'bin/install_megadrivers.py'),
101 libgallium_dri.full_path(),
102 dri_drivers_path,
103 gallium_dri_drivers,
104 )