meson: Build gallium trivial tests
[mesa.git] / src / gallium / meson.build
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
22 inc_gallium_drivers = include_directories('drivers')
23 inc_gallium_winsys = include_directories('winsys')
24
25 subdir('auxiliary')
26 subdir('auxiliary/pipe-loader')
27 subdir('winsys/sw/null')
28 if with_dri
29 subdir('winsys/sw/dri')
30 else
31 libswdri = []
32 endif
33 if with_gallium_drisw_kms
34 subdir('winsys/sw/kms-dri')
35 else
36 libswkmsdri = []
37 endif
38 subdir('winsys/sw/wrapper')
39 if with_platform_haiku
40 subdir('winsys/sw/hgl')
41 endif
42 if with_gallium_swr
43 if meson.version().version_compare('< 0.44.0')
44 error('SWR requires meson 0.44.0 or greater.')
45 endif
46 subdir('drivers/swr')
47 else
48 driver_swr = declare_dependency()
49 endif
50 if with_gallium_softpipe
51 subdir('drivers/softpipe')
52 if with_llvm
53 subdir('drivers/llvmpipe')
54 endif
55 else
56 driver_swrast = declare_dependency()
57 endif
58 if with_gallium_r300 or with_gallium_radeonsi or with_gallium_r600
59 subdir('winsys/radeon/drm')
60 endif
61 if with_gallium_r300
62 subdir('drivers/r300')
63 else
64 driver_r300 = declare_dependency()
65 endif
66 if with_gallium_r600
67 subdir('drivers/r600')
68 else
69 driver_r600 = declare_dependency()
70 endif
71 if with_gallium_radeonsi
72 subdir('winsys/amdgpu/drm')
73 subdir('drivers/radeonsi')
74 else
75 driver_radeonsi = declare_dependency()
76 endif
77 if with_gallium_nouveau
78 subdir('winsys/nouveau/drm')
79 subdir('drivers/nouveau')
80 else
81 driver_nouveau = declare_dependency()
82 endif
83 if with_gallium_freedreno
84 subdir('winsys/freedreno/drm')
85 subdir('drivers/freedreno')
86 else
87 driver_freedreno = declare_dependency()
88 endif
89 if with_gallium_vc4
90 subdir('winsys/vc4/drm')
91 subdir('drivers/vc4')
92 else
93 driver_vc4 = declare_dependency()
94 endif
95 if with_gallium_pl111
96 subdir('winsys/pl111/drm')
97 else
98 driver_pl111 = declare_dependency()
99 endif
100 if with_gallium_vc5
101 subdir('winsys/vc5/drm')
102 subdir('drivers/vc5')
103 else
104 driver_vc5 = declare_dependency()
105 endif
106 if with_gallium_etnaviv
107 subdir('winsys/etnaviv/drm')
108 subdir('drivers/etnaviv')
109 else
110 driver_etnaviv = declare_dependency()
111 endif
112 if with_gallium_imx
113 subdir('winsys/imx/drm')
114 else
115 driver_imx = declare_dependency()
116 endif
117 if with_gallium_tegra
118 subdir('winsys/tegra/drm')
119 subdir('drivers/tegra')
120 else
121 driver_tegra = declare_dependency()
122 endif
123 if with_gallium_i915
124 subdir('winsys/i915/drm')
125 subdir('drivers/i915')
126 else
127 driver_i915 = declare_dependency()
128 endif
129 if with_gallium_svga
130 subdir('winsys/svga/drm')
131 subdir('drivers/svga')
132 else
133 driver_svga = declare_dependency()
134 endif
135 if with_gallium_virgl
136 subdir('winsys/virgl/drm')
137 subdir('winsys/virgl/vtest')
138 subdir('drivers/virgl')
139 else
140 driver_virgl = declare_dependency()
141 endif
142 if with_gallium_opencl
143 # TODO: this isn't really clover specific, but ATM clover is the only
144 # consumer
145 subdir('targets/pipe-loader')
146
147 if meson.version().version_compare('< 0.44.0')
148 error('OpenCL requires meson 0.44.0 or greater.')
149 endif
150 subdir('state_trackers/clover')
151 subdir('targets/opencl')
152 endif
153 if with_dri
154 subdir('state_trackers/dri')
155 subdir('targets/dri')
156 endif
157 if with_osmesa == 'gallium'
158 subdir('state_trackers/osmesa')
159 subdir('targets/osmesa')
160 endif
161 if with_glx == 'gallium-xlib'
162 subdir('winsys/sw/xlib')
163 subdir('state_trackers/glx/xlib')
164 subdir('targets/libgl-xlib')
165 endif
166 if with_gallium_vdpau
167 subdir('state_trackers/vdpau')
168 subdir('targets/vdpau')
169 endif
170 if with_gallium_xvmc
171 subdir('state_trackers/xvmc')
172 subdir('targets/xvmc')
173 endif
174 if with_gallium_omx != 'disabled'
175 subdir('state_trackers/omx')
176 subdir('targets/omx')
177 endif
178 if with_gallium_va
179 subdir('state_trackers/va')
180 subdir('targets/va')
181 endif
182 if with_gallium_xa
183 subdir('state_trackers/xa')
184 subdir('targets/xa')
185 endif
186 if with_platform_haiku
187 subdir('state_trackers/hgl')
188 subdir('targets/haiku-softpipe')
189 endif
190 if with_gallium_st_nine
191 subdir('state_trackers/nine')
192 subdir('targets/d3dadapter9')
193 endif
194 if with_tests
195 subdir('tests')
196 endif