1# Copyright © 2017 Dylan Baker
2# Copyright © 2017-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
22inc_gallium_drivers = include_directories('drivers')
23inc_gallium_winsys = include_directories('winsys')
24inc_gallium_winsys_sw = include_directories('winsys/sw')
25
26subdir('auxiliary')
27subdir('auxiliary/pipe-loader')
28subdir('winsys/sw/null')
29if with_dri
30  subdir('winsys/sw/dri')
31else
32  libswdri = []
33endif
34if with_gallium_drisw_kms
35  subdir('winsys/sw/kms-dri')
36else
37  libswkmsdri = []
38endif
39if with_platform_windows
40  subdir('winsys/sw/gdi')
41else
42  libwsgdi = null_dep
43endif
44subdir('winsys/sw/wrapper')
45if with_platform_haiku
46  subdir('winsys/sw/hgl')
47endif
48if with_gallium_swr
49  subdir('drivers/swr')
50else
51  driver_swr = declare_dependency()
52endif
53if with_gallium_softpipe
54  subdir('drivers/softpipe')
55  if draw_with_llvm
56    subdir('drivers/llvmpipe')
57  endif
58else
59  driver_swrast = declare_dependency()
60endif
61if with_gallium_asahi
62  subdir('drivers/asahi')
63else
64  driver_asahi = declare_dependency()
65endif
66if with_gallium_r300 or with_gallium_radeonsi or with_gallium_r600
67  subdir('winsys/radeon/drm')
68endif
69if with_gallium_r300
70  subdir('drivers/r300')
71else
72  driver_r300 = declare_dependency()
73endif
74if with_gallium_r600
75  subdir('drivers/r600')
76else
77  driver_r600 = declare_dependency()
78endif
79if with_gallium_radeonsi
80  subdir('winsys/amdgpu/drm')
81  subdir('drivers/radeonsi')
82else
83  driver_radeonsi = declare_dependency()
84endif
85if with_gallium_nouveau
86  subdir('winsys/nouveau/drm')
87  subdir('drivers/nouveau')
88else
89  driver_nouveau = declare_dependency()
90endif
91if with_gallium_freedreno
92  subdir('winsys/freedreno/drm')
93  subdir('drivers/freedreno')
94else
95  driver_freedreno = declare_dependency()
96endif
97if with_gallium_vc4
98  subdir('winsys/vc4/drm')
99  subdir('drivers/vc4')
100else
101  driver_vc4 = declare_dependency()
102endif
103if with_gallium_panfrost
104  subdir('winsys/panfrost/drm')
105  subdir('drivers/panfrost')
106else
107  driver_panfrost = declare_dependency()
108endif
109if with_gallium_etnaviv
110  subdir('winsys/etnaviv/drm')
111  subdir('drivers/etnaviv')
112else
113  driver_etnaviv = declare_dependency()
114endif
115if with_gallium_kmsro
116  subdir('winsys/kmsro/drm')
117else
118  driver_kmsro = declare_dependency()
119endif
120if with_gallium_v3d
121  subdir('winsys/v3d/drm')
122  subdir('drivers/v3d')
123else
124  driver_v3d = declare_dependency()
125endif
126if with_gallium_tegra
127  subdir('winsys/tegra/drm')
128  subdir('drivers/tegra')
129else
130  driver_tegra = declare_dependency()
131endif
132if with_gallium_crocus
133  subdir('winsys/crocus/drm')
134  subdir('drivers/crocus')
135else
136  driver_crocus = declare_dependency()
137endif
138if with_gallium_iris
139  subdir('winsys/iris/drm')
140  subdir('drivers/iris')
141else
142  driver_iris = declare_dependency()
143endif
144if with_gallium_i915
145  subdir('winsys/i915/drm')
146  subdir('drivers/i915')
147else
148  driver_i915 = declare_dependency()
149endif
150if with_gallium_svga
151  if not with_platform_windows
152     subdir('winsys/svga/drm')
153  endif
154  subdir('drivers/svga')
155else
156  driver_svga = declare_dependency()
157endif
158if with_gallium_virgl
159  subdir('winsys/virgl/common')
160  subdir('winsys/virgl/drm')
161  subdir('winsys/virgl/vtest')
162  subdir('drivers/virgl')
163else
164  driver_virgl = declare_dependency()
165endif
166if with_gallium_lima
167  subdir('winsys/lima/drm')
168  subdir('drivers/lima')
169else
170  driver_lima = declare_dependency()
171endif
172if with_gallium_zink
173  subdir('drivers/zink')
174else
175  driver_zink = declare_dependency()
176endif
177if with_gallium_d3d12
178  subdir('drivers/d3d12')
179else
180  driver_d3d12 = declare_dependency()
181endif
182if with_gallium_opencl
183  # TODO: this isn't really clover specific, but ATM clover is the only
184  # consumer
185  subdir('targets/pipe-loader')
186
187  subdir('frontends/clover')
188  subdir('targets/opencl')
189endif
190if with_dri
191  subdir('frontends/dri')
192  subdir('targets/dri')
193endif
194if with_osmesa
195  subdir('frontends/osmesa')
196  subdir('targets/osmesa')
197endif
198if with_glx == 'gallium-xlib'
199  subdir('winsys/sw/xlib')
200  subdir('frontends/glx/xlib')
201  subdir('targets/libgl-xlib')
202endif
203if with_gallium_vdpau
204  subdir('frontends/vdpau')
205  subdir('targets/vdpau')
206endif
207if with_gallium_xvmc
208  subdir('frontends/xvmc')
209  subdir('targets/xvmc')
210endif
211if with_gallium_omx != 'disabled'
212  subdir('frontends/omx')
213  subdir('targets/omx')
214endif
215if with_gallium_va
216  subdir('frontends/va')
217  subdir('targets/va')
218endif
219if with_gallium_xa
220  subdir('frontends/xa')
221  subdir('targets/xa')
222endif
223if with_platform_haiku
224  subdir('frontends/hgl')
225  subdir('targets/haiku-softpipe')
226endif
227if with_gallium_st_nine
228  subdir('frontends/nine')
229  subdir('targets/d3dadapter9')
230endif
231if with_gallium_st_d3d10umd
232  subdir('frontends/d3d10umd')
233  subdir('targets/d3d10sw')
234endif
235if with_platform_windows
236  subdir('frontends/wgl')
237  if with_gallium_d3d12
238    subdir('winsys/d3d12/wgl')
239    subdir('targets/libgl-d3d12')
240  else
241    winsys_d3d12_wgl = declare_dependency()
242  endif
243  subdir('targets/wgl')
244  subdir('targets/libgl-gdi')
245endif
246if with_tests
247  subdir('targets/graw-null')
248  if with_platform_windows
249    subdir('targets/graw-gdi')
250  elif with_glx == 'gallium-xlib'
251    subdir('targets/graw-xlib')
252  endif
253  subdir('tests')
254endif
255if with_swrast_vk
256  subdir('frontends/lavapipe')
257  subdir('targets/lavapipe')
258endif
259