1 # Copyright © 2017 Intel Corporation
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:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
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
21 inc_util = include_directories('.')
26 files_mesa_util = files(
46 'fast_idiv_by_const.c',
47 'fast_idiv_by_const.h',
49 'format_r11g11b10f.h',
78 'register_allocate.c',
79 'register_allocate.h',
98 'texcompress_rgtc_tmp.h',
124 files_drirc = files('00-mesa-defaults.conf')
126 install_data(files_drirc, install_dir : join_paths(get_option('datadir'), 'drirc.d'))
129 prog_xmllint = find_program('xmllint', required : false, native : true)
130 if prog_xmllint.found()
132 'drirc xml validation',
134 args : ['--noout', '--valid', files_drirc],
140 files_xmlconfig = files(
145 format_srgb = custom_target(
147 input : ['format_srgb.py'],
148 output : 'format_srgb.c',
149 command : [prog_python, '@INPUT0@'],
153 deps_for_libmesa_util = [
163 if with_platform_android
164 deps_for_libmesa_util += dep_android
167 _libmesa_util = static_library(
169 [files_mesa_util, format_srgb],
170 include_directories : inc_common,
171 dependencies : deps_for_libmesa_util,
172 link_with: libmesa_format,
173 c_args : [c_msvc_compat_args, c_vis_args],
174 build_by_default : false
177 idep_mesautil = declare_dependency(
178 link_with : _libmesa_util,
179 include_directories : inc_util,
180 dependencies : [dep_zlib, dep_clock, dep_thread, dep_atomic, dep_m],
183 _libxmlconfig = static_library(
186 include_directories : inc_common,
187 dependencies : [idep_mesautil, dep_expat, dep_m],
189 c_msvc_compat_args, c_vis_args,
190 '-DSYSCONFDIR="@0@"'.format(
191 join_paths(get_option('prefix'), get_option('sysconfdir'))
193 '-DDATADIR="@0@"'.format(
194 join_paths(get_option('prefix'), get_option('datadir'))
197 build_by_default : false,
200 idep_xmlconfig = declare_dependency(
201 dependencies : [idep_xmlconfig_headers, dep_expat],
202 link_with : _libxmlconfig,
210 files('u_atomic_test.c'),
211 include_directories : inc_common,
212 dependencies : idep_mesautil,
213 c_args : [c_msvc_compat_args],
222 files('blob_test.c'),
223 include_directories : inc_common,
224 dependencies : idep_mesautil,
225 c_args : [c_msvc_compat_args],
234 files('rb_tree_test.c'),
235 include_directories : inc_common,
236 dependencies : idep_mesautil,
237 c_args : [c_msvc_compat_args],
246 files('roundeven_test.c'),
247 include_directories : inc_common,
248 c_args : [c_msvc_compat_args],
249 dependencies : [dep_m],
252 should_fail : meson.get_cross_property('xfail', '').contains('roundeven'),
255 # FIXME: this test crashes on windows
256 if host_machine.system() != 'windows'
261 files('mesa-sha1_test.c'),
262 include_directories : inc_common,
263 link_with : _libmesa_util,
264 c_args : [c_msvc_compat_args],
274 files('bitset_test.cpp'),
275 include_directories : inc_common,
276 dependencies : [idep_mesautil, idep_gtest],
281 subdir('tests/fast_idiv_by_const')
282 subdir('tests/fast_urem_by_const')
283 subdir('tests/hash_table')
284 if not (host_machine.system() == 'windows' and cc.get_id() == 'gcc')
285 # FIXME: These tests fail with mingw, but not with msvc.
286 subdir('tests/string_buffer')
288 if cc.has_header('sys/time.h') # MinGW has this, but Vanilla windows doesn't
289 subdir('tests/timespec')
293 # FIXME: this test on the Wine version in GitLab CI
294 if host_machine.system() != 'windows'
295 subdir('tests/sparse_array')
297 subdir('tests/format')
298 subdir('tests/vector')