meson: move libsensors dependency to libgallium
[mesa.git] / src / gallium / targets / dri / 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 # TODO: support non-static targets
22 # Static targets are always enabled in autotools (unless you modify
23 # configure.ac)
24
25 gallium_dri_c_args = [
26 '-DGALLIUM_DDEBUG',
27 '-DGALLIUM_NOOP',
28 '-DGALLIUM_RBUG',
29 '-DGALLIUME_TRACE',
30 ]
31 gallium_dri_ld_args = []
32 gallium_dri_link_with = []
33 gallium_dri_link_depends = []
34 gallium_dri_drivers = []
35
36 if with_ld_version_script
37 gallium_dri_ld_args += ['-Wl,--version-script', join_paths(meson.current_source_dir(), 'dri.sym')]
38 gallium_dri_link_depends += files('dri.sym')
39 endif
40 if with_ld_dynamic_list
41 gallium_dri_ld_args += ['-Wl,--dynamic-list', join_paths(meson.current_source_dir(), '../dri-vdpau.dyn')]
42 gallium_dri_link_depends += files('../dri-vdpau.dyn')
43 endif
44
45 if with_dri
46 gallium_dri_link_with += libswdri
47 endif
48 if with_gallium_drisw_kms
49 gallium_dri_link_with += libswkmsdri
50 endif
51
52 libgallium_dri = shared_library(
53 'gallium_dri',
54 files('target.c'),
55 include_directories : [
56 inc_common, inc_util, inc_dri_common, inc_gallium_drivers,
57 inc_gallium_winsys, include_directories('../../state_trackers/dri'),
58 ],
59 c_args : [c_vis_args],
60 cpp_args : [cpp_vis_args],
61 link_args : [ld_args_gc_sections, gallium_dri_ld_args],
62 link_depends : gallium_dri_link_depends,
63 link_with : [
64 libmesa_gallium, libdricommon, libmegadriver_stub, libdri, libgalliumvl,
65 libgallium, libddebug, libnoop, librbug, libtrace, libglapi,
66 libpipe_loader_static, libws_null, libwsw, gallium_dri_link_with,
67 ],
68 dependencies : [
69 dep_selinux, dep_expat, dep_libdrm, dep_llvm, dep_thread,
70 driver_swrast, driver_r300, driver_r600, driver_radeonsi, driver_nouveau,
71 driver_pl111, driver_vc4, driver_vc5, driver_freedreno, driver_etnaviv,
72 driver_imx, driver_i915, driver_svga, driver_virgl, driver_swr,
73 ],
74 )
75
76 foreach d : [[with_gallium_pl111, 'pl111_dri.so'],
77 [with_gallium_radeonsi, 'radeonsi_dri.so'],
78 [with_gallium_nouveau, 'nouveau_dri.so'],
79 [with_gallium_freedreno, ['msm_dri.so', 'kgsl_dri.so']],
80 [with_gallium_softpipe or with_gallium_swr, 'swrast_dri.so'],
81 [with_gallium_softpipe and with_gallium_drisw_kms, 'kms_swrast_dri.so'],
82 [with_gallium_vc4, 'vc4_dri.so'],
83 [with_gallium_vc5, 'vc5_dri.so'],
84 [with_gallium_etnaviv, 'etnaviv_dri.so'],
85 [with_gallium_imx, 'imx-drm_dri.so'],
86 [with_gallium_i915, 'i915_dri.so'],
87 [with_gallium_r300, 'r300_dri.so'],
88 [with_gallium_r600, 'r600_dri.so'],
89 [with_gallium_svga, 'vmwgfx_dri.so'],
90 [with_gallium_virgl, 'virtio_gpu_dri.so']]
91 if d[0]
92 gallium_dri_drivers += d[1]
93 endif
94 endforeach
95
96 meson.add_install_script(
97 join_paths(meson.source_root(), 'bin/install_megadrivers.py'),
98 libgallium_dri.full_path(),
99 dri_drivers_path,
100 gallium_dri_drivers,
101 )