xref: /aosp_15_r20/external/mesa3d/src/gallium/meson.build (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1# Copyright © 2017 Dylan Baker
2# Copyright © 2017-2018 Intel Corporation
3# SPDX-License-Identifier: MIT
4
5sym_config = configuration_data()
6
7foreach d : [[with_gallium_r300 or with_gallium_radeonsi or with_gallium_r600, 'radeon_drm_winsys_create'],
8             [with_gallium_radeonsi, 'amdgpu_winsys_create'],
9             [with_gallium_nouveau, 'nouveau_drm_screen_create'],
10             [with_gallium_freedreno, 'fd_drm_screen_create_renderonly'],
11             [amd_with_llvm and with_gallium_radeonsi, 'ac_init_shared_llvm_once']]
12  if d[0]
13    sym_config.set(d[1], d[1] + ';')
14  else
15    sym_config.set(d[1], '')
16  endif
17endforeach
18
19inc_gallium_drivers = include_directories('drivers')
20inc_gallium_winsys = include_directories('winsys')
21inc_gallium_winsys_sw = include_directories('winsys/sw')
22
23subdir('auxiliary')
24subdir('auxiliary/pipe-loader')
25subdir('winsys/sw/null')
26if with_dri
27  subdir('winsys/sw/dri')
28else
29  libswdri = []
30endif
31if with_gallium_drisw_kms
32  subdir('winsys/sw/kms-dri')
33else
34  libswkmsdri = []
35endif
36if with_platform_windows
37  subdir('winsys/sw/gdi')
38else
39  libwsgdi = null_dep
40endif
41subdir('winsys/sw/wrapper')
42if with_platform_haiku
43  subdir('winsys/sw/hgl')
44endif
45if with_gallium_softpipe
46  subdir('drivers/softpipe')
47else
48  driver_softpipe = declare_dependency()
49endif
50if with_any_llvmpipe
51  subdir('drivers/llvmpipe')
52else
53  driver_llvmpipe = declare_dependency()
54endif
55if with_any_llvmpipe and with_gallium_softpipe
56  driver_swrast = declare_dependency(
57    dependencies : [ driver_softpipe, driver_llvmpipe ],
58  )
59elif with_any_llvmpipe
60  driver_swrast = driver_llvmpipe
61elif with_gallium_softpipe
62  driver_swrast = driver_softpipe
63else
64  driver_swrast = declare_dependency()
65endif
66
67if with_gallium_asahi
68  subdir('winsys/asahi/drm')
69  subdir('drivers/asahi')
70else
71  driver_asahi = declare_dependency()
72endif
73if with_gallium_r300 or with_gallium_radeonsi or with_gallium_r600
74  subdir('winsys/radeon/drm')
75endif
76if with_gallium_r300
77  subdir('drivers/r300')
78else
79  driver_r300 = declare_dependency()
80endif
81if with_gallium_r600
82  subdir('drivers/r600')
83else
84  driver_r600 = declare_dependency()
85endif
86if with_gallium_radeonsi
87  subdir('winsys/amdgpu/drm')
88  subdir('drivers/radeonsi')
89else
90  driver_radeonsi = declare_dependency()
91endif
92if with_gallium_nouveau
93  subdir('winsys/nouveau/drm')
94  subdir('drivers/nouveau')
95else
96  driver_nouveau = declare_dependency()
97endif
98if with_gallium_freedreno
99  subdir('winsys/freedreno/drm')
100  subdir('drivers/freedreno')
101else
102  driver_freedreno = declare_dependency()
103endif
104if with_gallium_vc4
105  subdir('winsys/vc4/drm')
106  subdir('drivers/vc4')
107else
108  driver_vc4 = declare_dependency()
109endif
110if with_gallium_panfrost
111  subdir('winsys/panfrost/drm')
112  subdir('drivers/panfrost')
113else
114  driver_panfrost = declare_dependency()
115endif
116if with_gallium_etnaviv
117  subdir('winsys/etnaviv/drm')
118  subdir('drivers/etnaviv')
119else
120  driver_etnaviv = declare_dependency()
121endif
122if with_gallium_kmsro
123  subdir('winsys/kmsro/drm')
124else
125  driver_kmsro = declare_dependency()
126endif
127if with_gallium_v3d
128  subdir('winsys/v3d/drm')
129  subdir('drivers/v3d')
130else
131  driver_v3d = declare_dependency()
132endif
133if with_gallium_tegra
134  subdir('winsys/tegra/drm')
135  subdir('drivers/tegra')
136else
137  driver_tegra = declare_dependency()
138endif
139if with_gallium_crocus
140  subdir('winsys/crocus/drm')
141  subdir('drivers/crocus')
142else
143  driver_crocus = declare_dependency()
144endif
145if with_gallium_iris
146  subdir('winsys/iris/drm')
147  subdir('drivers/iris')
148else
149  driver_iris = declare_dependency()
150endif
151if with_gallium_i915
152  subdir('winsys/i915/drm')
153  subdir('drivers/i915')
154else
155  driver_i915 = declare_dependency()
156endif
157if with_gallium_svga
158  if not with_platform_windows
159     subdir('winsys/svga/drm')
160  endif
161  subdir('drivers/svga')
162else
163  driver_svga = declare_dependency()
164endif
165if with_gallium_virgl
166  subdir('winsys/virgl/common')
167  if not with_platform_windows
168    subdir('winsys/virgl/drm')
169    subdir('winsys/virgl/vtest')
170  endif
171  subdir('drivers/virgl')
172else
173  driver_virgl = declare_dependency()
174endif
175if with_gallium_lima
176  subdir('winsys/lima/drm')
177  subdir('drivers/lima')
178else
179  driver_lima = declare_dependency()
180endif
181if with_gallium_zink
182  subdir('drivers/zink')
183else
184  driver_zink = declare_dependency()
185endif
186if with_gallium_d3d12
187  subdir('drivers/d3d12')
188else
189  driver_d3d12 = declare_dependency()
190endif
191if with_gallium_clover or with_tests
192  # At the moment, clover and gallium/tests are the only two consumers
193  # for pipe-loader
194  subdir('targets/pipe-loader')
195endif
196if with_gallium_clover
197  subdir('frontends/clover')
198  subdir('targets/opencl')
199endif
200if with_gallium_rusticl
201  subdir('frontends/rusticl')
202  subdir('targets/rusticl')
203endif
204if with_glx == 'xlib'
205  subdir('winsys/sw/xlib')
206  subdir('frontends/glx/xlib')
207  subdir('targets/libgl-xlib')
208endif
209if with_gallium_va
210  subdir('frontends/va')
211  if not with_dri
212    subdir('targets/va')
213  endif
214endif
215if with_gallium_vdpau
216  subdir('frontends/vdpau')
217  if not with_dri
218    subdir('targets/vdpau')
219  endif
220endif
221if with_dri
222  subdir('frontends/dri')
223  subdir('targets/dri')
224endif
225if with_osmesa
226  subdir('frontends/osmesa')
227  subdir('targets/osmesa')
228endif
229if with_gallium_xa
230  subdir('frontends/xa')
231  subdir('targets/xa')
232endif
233if with_platform_haiku
234  subdir('frontends/hgl')
235endif
236if with_gallium_st_nine
237  subdir('frontends/nine')
238  subdir('targets/d3dadapter9')
239endif
240if with_gallium_st_d3d10umd
241  subdir('frontends/d3d10umd')
242  subdir('targets/d3d10umd')
243endif
244if with_platform_windows
245  if with_opengl
246    subdir('frontends/wgl')
247    if with_gallium_d3d12
248      subdir('winsys/d3d12/wgl')
249    else
250      winsys_d3d12_wgl = declare_dependency()
251    endif
252    subdir('targets/wgl')
253    subdir('targets/libgl-gdi')
254  endif
255endif
256if with_tests
257  subdir('tests')
258endif
259if with_swrast_vk
260  subdir('frontends/lavapipe')
261  subdir('targets/lavapipe')
262endif
263
264if with_teflon
265  subdir('frontends/teflon')
266  subdir('targets/teflon')
267endif
268