323b337266f168e6e7c2296435e86ed9a271b407
[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_depends = []
34 gallium_dri_link_depends = []
35 gallium_dri_drivers = []
36 gallium_dri_sources = []
37
38 if with_ld_version_script
39 gallium_dri_ld_args += ['-Wl,--version-script', join_paths(meson.current_source_dir(), 'dri.sym')]
40 gallium_dri_link_depends += files('dri.sym')
41 endif
42 if with_ld_dynamic_list
43 gallium_dri_ld_args += ['-Wl,--dynamic-list', join_paths(meson.current_source_dir(), '../dri-vdpau.dyn')]
44 gallium_dri_link_depends += files('../dri-vdpau.dyn')
45 endif
46
47 if with_dri
48 gallium_dri_link_with += libswdri
49 endif
50 if with_gallium_drisw_kms
51 gallium_dri_link_with += libswkmsdri
52 endif
53
54 if with_gallium_pl111
55 gallium_dri_c_args += '-DGALLIUM_PL111'
56 gallium_dri_link_with += [libpl111winsys]
57 gallium_dri_drivers += 'pl111_dri.so'
58 endif
59 if with_gallium_radeonsi
60 gallium_dri_c_args += '-DGALLIUM_RADEONSI'
61 gallium_dri_link_with += [
62 libradeonsi, libamdgpuwinsys, libradeon, libamd_common,
63 ]
64 gallium_dri_drivers += 'radeonsi_dri.so'
65 gallium_dri_sources += [si_driinfo_h]
66 endif
67 if with_gallium_nouveau
68 gallium_dri_c_args += '-DGALLIUM_NOUVEAU'
69 gallium_dri_link_with += [libnouveauwinsys, libnouveau]
70 gallium_dri_drivers += 'nouveau_dri.so'
71 endif
72 if with_gallium_freedreno
73 gallium_dri_c_args += '-DGALLIUM_FREEDRENO'
74 gallium_dri_link_with += [libfreedrenowinsys, libfreedreno]
75 gallium_dri_drivers += 'msm_dri.so'
76 gallium_dri_drivers += 'kgsl_dri.so'
77 endif
78 if with_gallium_softpipe
79 gallium_dri_c_args += '-DGALLIUM_SOFTPIPE'
80 gallium_dri_link_with += libsoftpipe
81 gallium_dri_drivers += 'swrast_dri.so'
82 if with_gallium_drisw_kms
83 gallium_dri_drivers += 'kms_swrast_dri.so'
84 endif
85 if with_llvm
86 gallium_dri_c_args += '-DGALLIUM_LLVMPIPE'
87 gallium_dri_link_with += libllvmpipe
88 endif
89 endif
90 if with_gallium_vc4
91 gallium_dri_c_args += '-DGALLIUM_VC4'
92 gallium_dri_link_with += [libvc4, libvc4winsys]
93 gallium_dri_drivers += 'vc4_dri.so'
94 endif
95 if with_gallium_vc5
96 gallium_dri_c_args += '-DGALLIUM_VC5'
97 gallium_dri_link_with += [libvc5, libvc5winsys, libbroadcom_vc5]
98 gallium_dri_drivers += 'vc5_dri.so'
99 endif
100 if with_gallium_etnaviv
101 gallium_dri_c_args += '-DGALLIUM_ETNAVIV'
102 gallium_dri_link_with += [libetnaviv, libetnavivdrm]
103 gallium_dri_drivers += 'etnaviv_dri.so'
104 endif
105 if with_gallium_imx
106 gallium_dri_c_args += '-DGALLIUM_IMX'
107 gallium_dri_link_with += libimxdrm
108 gallium_dri_drivers += 'imx-drm_dri.so'
109 endif
110 if with_gallium_i915
111 gallium_dri_c_args += '-DGALLIUM_I915'
112 gallium_dri_link_with += [libi915, libi915drm]
113 gallium_dri_drivers += 'i915_dri.so'
114 endif
115 if with_gallium_r300
116 gallium_dri_c_args += '-DGALLIUM_R300'
117 gallium_dri_link_with += libr300
118 gallium_dri_drivers += 'r300_dri.so'
119 endif
120 if with_gallium_r600
121 gallium_dri_c_args += '-DGALLIUM_R600'
122 gallium_dri_link_with += libr600
123 gallium_dri_drivers += 'r600_dri.so'
124 endif
125 if with_gallium_svga
126 gallium_dri_c_args += '-DGALLIUM_VMWGFX'
127 gallium_dri_link_with += [libsvga, libsvgadrm]
128 gallium_dri_drivers += 'vmwgfx_dri.so'
129 endif
130 if with_gallium_virgl
131 gallium_dri_c_args += '-DGALLIUM_VIRGL'
132 gallium_dri_link_with += [libvirgl, libvirgldrm, libvirglvtest]
133 gallium_dri_drivers += 'virtio_gpu_dri.so'
134 endif
135
136 if with_gallium_radeonsi or with_gallium_r300 or with_gallium_r600
137 gallium_dri_link_with += libradeonwinsys
138 endif
139
140 if with_gallium_vc4 or with_gallium_vc5
141 gallium_dri_link_with += libbroadcom_cle
142 endif
143
144 if with_gallium_vc4 or with_gallium_vc5 or with_gallium_radeonsi
145 gallium_dri_link_with += libnir
146 endif
147
148 libgallium_dri = shared_library(
149 'gallium_dri',
150 [files('target.c'), gallium_dri_sources],
151 include_directories : [
152 inc_common, inc_util, inc_dri_common, inc_gallium_drivers,
153 inc_gallium_winsys, include_directories('../../state_trackers/dri'),
154 ],
155 c_args : [c_vis_args, gallium_dri_c_args],
156 cpp_args : [cpp_vis_args],
157 link_args : [ld_args_gc_sections, gallium_dri_ld_args],
158 link_depends : gallium_dri_link_depends,
159 link_with : [
160 libmesa_gallium, libdricommon, libmegadriver_stub, libdri, libgalliumvl,
161 libgallium, libddebug, libnoop, librbug, libtrace, libglapi,
162 libpipe_loader_static, libws_null, libwsw, gallium_dri_link_with,
163 ],
164 dependencies : [
165 gallium_dri_depends, dep_selinux, dep_expat, dep_libdrm, dep_llvm,
166 dep_thread,
167 ],
168 )
169
170 meson.add_install_script(
171 join_paths(meson.source_root(), 'bin/install_megadrivers.py'),
172 libgallium_dri.full_path(),
173 dri_drivers_path,
174 gallium_dri_drivers,
175 )