lima: implement PLB PP stream cache
[mesa.git] / src / util / meson.build
1 # Copyright © 2017 Intel Corporation
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 inc_util = include_directories('.')
22
23 subdir('format')
24 subdir('xmlpool')
25
26 files_mesa_util = files(
27 'anon_file.h',
28 'anon_file.c',
29 'bigmath.h',
30 'bitscan.c',
31 'bitscan.h',
32 'bitset.h',
33 'blob.c',
34 'blob.h',
35 'build_id.c',
36 'build_id.h',
37 'crc32.c',
38 'crc32.h',
39 'dag.c',
40 'debug.c',
41 'debug.h',
42 'disk_cache.c',
43 'disk_cache.h',
44 'double.c',
45 'double.h',
46 'fast_idiv_by_const.c',
47 'fast_idiv_by_const.h',
48 'fnv1a.h',
49 'format_r11g11b10f.h',
50 'format_rgb9e5.h',
51 'format_srgb.h',
52 'futex.h',
53 'half_float.c',
54 'half_float.h',
55 'hash_table.c',
56 'hash_table.h',
57 'list.h',
58 'macros.h',
59 'mesa-sha1.c',
60 'mesa-sha1.h',
61 'os_time.c',
62 'os_time.h',
63 'os_file.c',
64 'os_misc.c',
65 'os_misc.h',
66 'os_socket.c',
67 'os_socket.h',
68 'u_process.c',
69 'u_process.h',
70 'sha1/sha1.c',
71 'sha1/sha1.h',
72 'ralloc.c',
73 'ralloc.h',
74 'rand_xor.c',
75 'rand_xor.h',
76 'rb_tree.c',
77 'rb_tree.h',
78 'register_allocate.c',
79 'register_allocate.h',
80 'rgtc.c',
81 'rgtc.h',
82 'rounding.h',
83 'set.c',
84 'set.h',
85 'simple_list.h',
86 'simple_mtx.h',
87 'slab.c',
88 'slab.h',
89 'softfloat.c',
90 'softfloat.h',
91 'sparse_array.c',
92 'sparse_array.h',
93 'string_buffer.c',
94 'string_buffer.h',
95 'strndup.h',
96 'strtod.c',
97 'strtod.h',
98 'texcompress_rgtc_tmp.h',
99 'timespec.h',
100 'u_atomic.c',
101 'u_atomic.h',
102 'u_dynarray.h',
103 'u_endian.h',
104 'u_queue.c',
105 'u_queue.h',
106 'u_string.h',
107 'u_thread.h',
108 'u_vector.c',
109 'u_vector.h',
110 'u_math.c',
111 'u_math.h',
112 'u_mm.c',
113 'u_mm.h',
114 'u_debug.c',
115 'u_debug.h',
116 'u_cpu_detect.c',
117 'u_cpu_detect.h',
118 'vma.c',
119 'vma.h',
120 'xxhash.h',
121 )
122
123 files_drirc = files('00-mesa-defaults.conf')
124
125 install_data(files_drirc, install_dir : join_paths(get_option('datadir'), 'drirc.d'))
126
127 if with_tests
128 prog_xmllint = find_program('xmllint', required : false, native : true)
129 if prog_xmllint.found()
130 test(
131 'drirc xml validation',
132 prog_xmllint,
133 args : ['--noout', '--valid', files_drirc],
134 suite : ['util'],
135 )
136 endif
137 endif
138
139 files_xmlconfig = files(
140 'xmlconfig.c',
141 'xmlconfig.h',
142 )
143
144 format_srgb = custom_target(
145 'format_srgb',
146 input : ['format_srgb.py'],
147 output : 'format_srgb.c',
148 command : [prog_python, '@INPUT0@'],
149 capture : true,
150 )
151
152 deps_for_libmesa_util = [
153 dep_zlib,
154 dep_clock,
155 dep_thread,
156 dep_atomic,
157 dep_m,
158 dep_valgrind,
159 dep_zstd,
160 ]
161
162 if with_platform_android
163 deps_for_libmesa_util += dep_android
164 endif
165
166 _libmesa_util = static_library(
167 'mesa_util',
168 [files_mesa_util, format_srgb],
169 include_directories : inc_common,
170 dependencies : deps_for_libmesa_util,
171 link_with: libmesa_format,
172 c_args : [c_msvc_compat_args, c_vis_args],
173 build_by_default : false
174 )
175
176 idep_mesautil = declare_dependency(
177 link_with : _libmesa_util,
178 include_directories : inc_util,
179 dependencies : [dep_zlib, dep_clock, dep_thread, dep_atomic, dep_m],
180 )
181
182 _libxmlconfig = static_library(
183 'xmlconfig',
184 files_xmlconfig,
185 include_directories : inc_common,
186 dependencies : [idep_mesautil, dep_expat, dep_m],
187 c_args : [
188 c_msvc_compat_args, c_vis_args,
189 '-DSYSCONFDIR="@0@"'.format(
190 join_paths(get_option('prefix'), get_option('sysconfdir'))
191 ),
192 '-DDATADIR="@0@"'.format(
193 join_paths(get_option('prefix'), get_option('datadir'))
194 ),
195 ],
196 build_by_default : false,
197 )
198
199 idep_xmlconfig = declare_dependency(
200 dependencies : [idep_xmlconfig_headers, dep_expat],
201 link_with : _libxmlconfig,
202 )
203
204 if with_tests
205 test(
206 'u_atomic',
207 executable(
208 'u_atomic_test',
209 files('u_atomic_test.c'),
210 include_directories : inc_common,
211 dependencies : idep_mesautil,
212 c_args : [c_msvc_compat_args],
213 ),
214 suite : ['util'],
215 )
216
217 test(
218 'blob',
219 executable(
220 'blob_test',
221 files('blob_test.c'),
222 include_directories : inc_common,
223 dependencies : idep_mesautil,
224 c_args : [c_msvc_compat_args],
225 ),
226 suite : ['util'],
227 )
228
229 test(
230 'rb_tree',
231 executable(
232 'rb_tree_test',
233 files('rb_tree_test.c'),
234 include_directories : inc_common,
235 dependencies : idep_mesautil,
236 c_args : [c_msvc_compat_args],
237 ),
238 suite : ['util'],
239 )
240
241 test(
242 'roundeven',
243 executable(
244 'roundeven_test',
245 files('roundeven_test.c'),
246 include_directories : inc_common,
247 c_args : [c_msvc_compat_args],
248 dependencies : [dep_m],
249 ),
250 suite : ['util'],
251 should_fail : meson.get_cross_property('xfail', '').contains('roundeven'),
252 )
253
254 # FIXME: this test crashes on windows
255 if host_machine.system() != 'windows'
256 test(
257 'mesa-sha1',
258 executable(
259 'mesa-sha1_test',
260 files('mesa-sha1_test.c'),
261 include_directories : inc_common,
262 link_with : _libmesa_util,
263 c_args : [c_msvc_compat_args],
264 ),
265 suite : ['util'],
266 )
267 endif
268
269 test(
270 'bitset',
271 executable(
272 'bitset_test',
273 files('bitset_test.cpp'),
274 include_directories : inc_common,
275 dependencies : [idep_mesautil, idep_gtest],
276 ),
277 suite : ['util'],
278 )
279
280 subdir('tests/fast_idiv_by_const')
281 subdir('tests/fast_urem_by_const')
282 subdir('tests/hash_table')
283 if not (host_machine.system() == 'windows' and cc.get_id() == 'gcc')
284 # FIXME: These tests fail with mingw, but not with msvc.
285 subdir('tests/string_buffer')
286 endif
287 if cc.has_header('sys/time.h') # MinGW has this, but Vanilla windows doesn't
288 subdir('tests/timespec')
289 endif
290 subdir('tests/vma')
291 subdir('tests/set')
292 subdir('tests/sparse_array')
293 subdir('tests/format')
294 subdir('tests/vector')
295 endif