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(
47 'fast_idiv_by_const.c',
48 'fast_idiv_by_const.h',
49 'format_r11g11b10f.h',
78 'register_allocate.c',
79 'register_allocate.h',
98 'texcompress_rgtc_tmp.h',
125 files_drirc = files('00-mesa-defaults.conf')
127 install_data(files_drirc, install_dir : join_paths(get_option('datadir'), 'drirc.d'))
130 prog_xmllint = find_program('xmllint', required : false, native : true)
131 if prog_xmllint.found()
133 'drirc xml validation',
135 args : ['--noout', '--valid', files_drirc],
141 files_xmlconfig = files(
146 format_srgb = custom_target(
148 input : ['format_srgb.py'],
149 output : 'format_srgb.c',
150 command : [prog_python, '@INPUT0@'],
154 deps_for_libmesa_util = [
164 if with_platform_android
165 deps_for_libmesa_util += dep_android
168 _libmesa_util = static_library(
170 [files_mesa_util, format_srgb],
171 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
172 dependencies : deps_for_libmesa_util,
173 link_with: libmesa_format,
174 c_args : [c_msvc_compat_args],
175 gnu_symbol_visibility : 'hidden',
176 build_by_default : false
179 idep_mesautil = declare_dependency(
180 link_with : _libmesa_util,
181 include_directories : inc_util,
182 dependencies : [dep_zlib, dep_clock, dep_thread, dep_atomic, dep_m],
185 _libxmlconfig = static_library(
188 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
189 dependencies : [idep_mesautil, dep_expat, dep_m],
192 '-DSYSCONFDIR="@0@"'.format(
193 join_paths(get_option('prefix'), get_option('sysconfdir'))
195 '-DDATADIR="@0@"'.format(
196 join_paths(get_option('prefix'), get_option('datadir'))
199 gnu_symbol_visibility : 'hidden',
200 build_by_default : false,
203 idep_xmlconfig = declare_dependency(
204 dependencies : [idep_xmlconfig_headers, dep_expat],
205 link_with : _libxmlconfig,
213 files('u_atomic_test.c'),
214 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
215 dependencies : idep_mesautil,
216 c_args : [c_msvc_compat_args],
225 files('blob_test.c'),
226 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
227 dependencies : idep_mesautil,
228 c_args : [c_msvc_compat_args],
237 files('rb_tree_test.c'),
238 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
239 dependencies : idep_mesautil,
240 c_args : [c_msvc_compat_args],
249 files('roundeven_test.c'),
250 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
251 c_args : [c_msvc_compat_args],
252 dependencies : [dep_m],
255 should_fail : meson.get_cross_property('xfail', '').contains('roundeven'),
258 # FIXME: this test crashes on windows
259 if host_machine.system() != 'windows'
264 files('mesa-sha1_test.c'),
265 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
266 link_with : _libmesa_util,
267 c_args : [c_msvc_compat_args],
277 files('bitset_test.cpp'),
278 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
279 dependencies : [idep_mesautil, idep_gtest],
284 process_test_exe = executable(
286 files('process_test.c'),
287 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
288 dependencies : idep_mesautil,
289 c_args : [c_msvc_compat_args],
291 if (host_machine.system() == 'windows' and build_machine.system() != 'windows')
292 # This conversion is only required on mingw crosscompilers, otherwise we hit at least one of these issues
293 # https://gitlab.freedesktop.org/mesa/mesa/-/issues/2690
294 # https://gitlab.freedesktop.org/mesa/mesa/-/issues/2788
295 prog_winepath = find_program('winepath')
296 process_test_exe_full_path = run_command(
297 prog_winepath, '-w', process_test_exe.full_path()
300 process_test_exe_full_path = process_test_exe.full_path()
307 env: ['BUILD_FULL_PATH='+process_test_exe_full_path]
310 subdir('tests/fast_idiv_by_const')
311 subdir('tests/fast_urem_by_const')
312 subdir('tests/hash_table')
313 if not (host_machine.system() == 'windows' and cc.get_id() == 'gcc')
314 # FIXME: These tests fail with mingw, but not with msvc.
315 subdir('tests/string_buffer')
317 if cc.has_header('sys/time.h') # MinGW has this, but Vanilla windows doesn't
318 subdir('tests/timespec')
322 subdir('tests/sparse_array')
323 subdir('tests/format')
324 subdir('tests/vector')