2017-09-15 01:57:17 +01:00
|
|
|
# Copyright © 2017 Intel Corporation
|
|
|
|
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
# of this software and associated documentation files (the "Software"), to deal
|
|
|
|
# in the Software without restriction, including without limitation the rights
|
|
|
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
# copies of the Software, and to permit persons to whom the Software is
|
|
|
|
# furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
# The above copyright notice and this permission notice shall be included in
|
|
|
|
# all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
# SOFTWARE.
|
|
|
|
|
2022-11-10 04:34:47 +00:00
|
|
|
# inc_util only depends inc_include, this folder and nothing else under src
|
|
|
|
# so we use include_directories('..') instead of inc_src to tell the fact
|
|
|
|
# util is self contained.
|
|
|
|
inc_util = [inc_include, include_directories('..')]
|
2017-09-15 01:57:17 +01:00
|
|
|
|
2019-06-27 23:05:31 +01:00
|
|
|
subdir('format')
|
2017-09-21 04:11:32 +01:00
|
|
|
|
2017-09-15 01:57:17 +01:00
|
|
|
files_mesa_util = files(
|
2018-01-18 20:29:14 +00:00
|
|
|
'anon_file.h',
|
|
|
|
'anon_file.c',
|
2017-12-29 21:30:32 +00:00
|
|
|
'bigmath.h',
|
2017-09-15 01:57:17 +01:00
|
|
|
'bitscan.c',
|
|
|
|
'bitscan.h',
|
|
|
|
'bitset.h',
|
2019-09-18 20:32:00 +01:00
|
|
|
'blob.c',
|
|
|
|
'blob.h',
|
2017-09-15 01:57:17 +01:00
|
|
|
'build_id.c',
|
|
|
|
'build_id.h',
|
2020-10-31 23:18:34 +00:00
|
|
|
'cnd_monotonic.h',
|
2020-03-26 01:11:44 +00:00
|
|
|
'compiler.h',
|
2021-03-04 05:34:34 +00:00
|
|
|
'compress.c',
|
|
|
|
'compress.h',
|
2017-09-15 01:57:17 +01:00
|
|
|
'crc32.c',
|
|
|
|
'crc32.h',
|
2019-02-27 19:12:59 +00:00
|
|
|
'dag.c',
|
2017-09-15 01:57:17 +01:00
|
|
|
'disk_cache.c',
|
|
|
|
'disk_cache.h',
|
2020-07-30 05:50:02 +01:00
|
|
|
'disk_cache_os.c',
|
|
|
|
'disk_cache_os.h',
|
2018-09-06 15:01:34 +01:00
|
|
|
'double.c',
|
|
|
|
'double.h',
|
2020-08-31 17:29:10 +01:00
|
|
|
'enum_operators.h',
|
2018-09-23 17:57:51 +01:00
|
|
|
'fast_idiv_by_const.c',
|
|
|
|
'fast_idiv_by_const.h',
|
2017-09-15 01:57:17 +01:00
|
|
|
'format_r11g11b10f.h',
|
|
|
|
'format_rgb9e5.h',
|
|
|
|
'format_srgb.h',
|
2020-10-19 04:33:44 +01:00
|
|
|
'fossilize_db.c',
|
|
|
|
'fossilize_db.h',
|
2022-09-03 09:58:05 +01:00
|
|
|
'futex.c',
|
2017-10-22 16:38:26 +01:00
|
|
|
'futex.h',
|
2022-11-02 14:43:19 +00:00
|
|
|
'glheader.h',
|
2017-09-15 01:57:17 +01:00
|
|
|
'half_float.c',
|
|
|
|
'half_float.h',
|
|
|
|
'hash_table.c',
|
|
|
|
'hash_table.h',
|
2020-09-08 19:41:14 +01:00
|
|
|
'u_idalloc.c',
|
|
|
|
'u_idalloc.h',
|
2017-09-15 01:57:17 +01:00
|
|
|
'list.h',
|
mesa: Promote Intel's simple logging façade for Android to util/
I'm bringing up freedreno Vulkan on an Android phone, and my pains are
exactly what Chad said when working on Intel's vulkan for Android in
aa716db0f64d ("intel: Add simple logging façade for Android (v2)"):
On Android, stdio goes to /dev/null. On Android, remote gdb is even
more painful than the usual remote gdb. On Android, nothing works like
you expect and debugging is hell. I need logging.
This patch introduces a small, simple logging API that can easily wrap
Android's API. On non-Android platforms, this logger does nothing
fancy. It follows the time-honored Unix tradition of spewing
everything to stderr with minimal fuss.
My goal here is not perfection. My goal is to make a minimal, clean API,
that people hate merely a little instead of a lot, and that's good
enough to let me bring up Android Vulkan. And it needs to be fast,
which means it must be small. No one wants to their game to miss frames
while aiming a flaming bow into the jaws of an angry robot t-rex, and
thus become t-rex breakfast, because some fool had too much fun desiging
a bloated, ideal logging API.
Compared to trusty fprintf, _mesa_log[ewi]() is actually usable on
Android. Compared to os_log_message(), this has different error levels
and supports format arguments.
The only code change in the move is wrapping flockfile/funlockfile in
!DETECT_OS_WINDOWS, since mingw32 doesn't have it. Windows likely wants
different logging code, anyway.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6806>
2020-09-21 20:53:14 +01:00
|
|
|
'log.c',
|
2017-09-15 01:57:17 +01:00
|
|
|
'macros.h',
|
2020-08-04 18:58:11 +01:00
|
|
|
'memstream.c',
|
|
|
|
'memstream.h',
|
2017-09-15 01:57:17 +01:00
|
|
|
'mesa-sha1.c',
|
|
|
|
'mesa-sha1.h',
|
2017-10-22 16:38:44 +01:00
|
|
|
'os_time.c',
|
|
|
|
'os_time.h',
|
2019-01-28 15:44:12 +00:00
|
|
|
'os_file.c',
|
2021-08-11 09:17:46 +01:00
|
|
|
'os_memory_fd.c',
|
2018-10-29 18:21:07 +00:00
|
|
|
'os_misc.c',
|
|
|
|
'os_misc.h',
|
2019-12-11 23:01:11 +00:00
|
|
|
'os_socket.c',
|
|
|
|
'os_socket.h',
|
2021-11-04 16:23:05 +00:00
|
|
|
'ptralloc.h',
|
2021-05-24 10:11:46 +01:00
|
|
|
'perf/u_trace.h',
|
|
|
|
'perf/u_trace.c',
|
|
|
|
'perf/u_trace_priv.h',
|
2018-07-10 23:00:13 +01:00
|
|
|
'u_process.c',
|
|
|
|
'u_process.h',
|
2020-11-10 17:00:54 +00:00
|
|
|
'u_qsort.cpp',
|
|
|
|
'u_qsort.h',
|
2022-09-03 11:04:49 +01:00
|
|
|
'rwlock.c',
|
2020-10-14 05:06:21 +01:00
|
|
|
'rwlock.h',
|
2017-09-15 01:57:17 +01:00
|
|
|
'sha1/sha1.c',
|
|
|
|
'sha1/sha1.h',
|
|
|
|
'ralloc.c',
|
|
|
|
'ralloc.h',
|
|
|
|
'rand_xor.c',
|
|
|
|
'rand_xor.h',
|
2018-04-05 16:21:49 +01:00
|
|
|
'rb_tree.c',
|
|
|
|
'rb_tree.h',
|
2017-09-15 01:57:17 +01:00
|
|
|
'register_allocate.c',
|
|
|
|
'register_allocate.h',
|
|
|
|
'rgtc.c',
|
|
|
|
'rgtc.h',
|
|
|
|
'rounding.h',
|
|
|
|
'set.c',
|
|
|
|
'set.h',
|
2022-08-16 18:42:52 +01:00
|
|
|
'simple_mtx.c',
|
2017-10-16 08:06:49 +01:00
|
|
|
'simple_mtx.h',
|
2017-09-15 01:57:17 +01:00
|
|
|
'slab.c',
|
|
|
|
'slab.h',
|
2019-02-12 08:51:31 +00:00
|
|
|
'softfloat.c',
|
|
|
|
'softfloat.h',
|
2019-10-05 20:07:50 +01:00
|
|
|
'sparse_array.c',
|
|
|
|
'sparse_array.h',
|
2017-09-15 01:57:17 +01:00
|
|
|
'string_buffer.c',
|
|
|
|
'string_buffer.h',
|
|
|
|
'strndup.h',
|
|
|
|
'strtod.c',
|
|
|
|
'strtod.h',
|
|
|
|
'texcompress_rgtc_tmp.h',
|
2019-07-29 10:54:04 +01:00
|
|
|
'timespec.h',
|
2017-09-15 01:57:17 +01:00
|
|
|
'u_atomic.c',
|
|
|
|
'u_atomic.h',
|
2022-06-18 16:55:49 +01:00
|
|
|
'u_call_once.c',
|
|
|
|
'u_call_once.h',
|
2021-09-30 15:34:38 +01:00
|
|
|
'u_debug_describe.c',
|
|
|
|
'u_debug_describe.h',
|
|
|
|
'u_debug_refcnt.c',
|
|
|
|
'u_debug_refcnt.h',
|
2022-07-01 03:25:19 +01:00
|
|
|
'u_dl.c',
|
|
|
|
'u_dl.h',
|
2017-09-15 01:57:17 +01:00
|
|
|
'u_dynarray.h',
|
|
|
|
'u_endian.h',
|
2021-09-30 15:34:38 +01:00
|
|
|
'u_hash_table.c',
|
|
|
|
'u_hash_table.h',
|
2022-07-01 03:25:19 +01:00
|
|
|
'u_pointer.h',
|
2017-09-15 01:57:17 +01:00
|
|
|
'u_queue.c',
|
|
|
|
'u_queue.h',
|
|
|
|
'u_string.h',
|
2022-10-14 17:48:34 +01:00
|
|
|
'u_thread.c',
|
2017-09-15 01:57:17 +01:00
|
|
|
'u_thread.h',
|
|
|
|
'u_vector.c',
|
|
|
|
'u_vector.h',
|
2018-08-17 01:20:38 +01:00
|
|
|
'u_math.c',
|
|
|
|
'u_math.h',
|
2020-03-31 23:44:08 +01:00
|
|
|
'u_memset.h',
|
2019-11-28 20:49:02 +00:00
|
|
|
'u_mm.c',
|
|
|
|
'u_mm.h',
|
2018-10-01 19:55:27 +01:00
|
|
|
'u_debug.c',
|
|
|
|
'u_debug.h',
|
2020-02-10 12:08:28 +00:00
|
|
|
'u_debug_memory.c',
|
2018-10-01 19:59:21 +01:00
|
|
|
'u_cpu_detect.c',
|
|
|
|
'u_cpu_detect.h',
|
2022-03-29 23:54:45 +01:00
|
|
|
'u_printf.c',
|
2020-11-18 06:20:50 +00:00
|
|
|
'u_printf.h',
|
2022-04-19 16:57:45 +01:00
|
|
|
'u_worklist.c',
|
|
|
|
'u_worklist.h',
|
2021-11-12 04:30:37 +00:00
|
|
|
'vl_vlc.h',
|
|
|
|
'vl_rbsp.h',
|
2018-01-07 01:28:01 +00:00
|
|
|
'vma.c',
|
|
|
|
'vma.h',
|
2020-01-18 05:47:19 +00:00
|
|
|
'xxhash.h',
|
2021-11-10 14:57:48 +00:00
|
|
|
'indices/u_indices.h',
|
|
|
|
'indices/u_indices_priv.h',
|
|
|
|
'indices/u_primconvert.c',
|
|
|
|
'indices/u_primconvert.h',
|
2022-06-13 17:31:20 +01:00
|
|
|
'mesa_cache_db.c',
|
|
|
|
'mesa_cache_db.h',
|
2017-09-15 01:57:17 +01:00
|
|
|
)
|
|
|
|
|
2019-02-26 12:32:04 +00:00
|
|
|
files_drirc = files('00-mesa-defaults.conf')
|
|
|
|
|
|
|
|
if with_tests
|
|
|
|
prog_xmllint = find_program('xmllint', required : false, native : true)
|
|
|
|
if prog_xmllint.found()
|
|
|
|
test(
|
|
|
|
'drirc xml validation',
|
|
|
|
prog_xmllint,
|
|
|
|
args : ['--noout', '--valid', files_drirc],
|
|
|
|
suite : ['util'],
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
endif
|
2017-09-15 01:57:17 +01:00
|
|
|
|
|
|
|
files_xmlconfig = files(
|
|
|
|
'xmlconfig.c',
|
|
|
|
'xmlconfig.h',
|
|
|
|
)
|
|
|
|
|
2021-02-21 19:28:37 +00:00
|
|
|
files_xmlconfig += custom_target(
|
|
|
|
'driconf_static.h',
|
|
|
|
input: ['driconf_static.py', '00-mesa-defaults.conf'],
|
|
|
|
output: 'driconf_static.h',
|
|
|
|
command: [
|
|
|
|
prog_python, '@INPUT0@', '@INPUT1@', '@OUTPUT@'
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2017-09-15 01:57:17 +01:00
|
|
|
format_srgb = custom_target(
|
|
|
|
'format_srgb',
|
|
|
|
input : ['format_srgb.py'],
|
|
|
|
output : 'format_srgb.c',
|
2018-08-09 09:27:26 +01:00
|
|
|
command : [prog_python, '@INPUT0@'],
|
2017-09-15 01:57:17 +01:00
|
|
|
capture : true,
|
|
|
|
)
|
|
|
|
|
2019-09-03 19:43:40 +01:00
|
|
|
deps_for_libmesa_util = [
|
|
|
|
dep_zlib,
|
|
|
|
dep_clock,
|
|
|
|
dep_thread,
|
|
|
|
dep_atomic,
|
|
|
|
dep_m,
|
2019-09-18 20:32:00 +01:00
|
|
|
dep_valgrind,
|
2019-10-31 20:26:00 +00:00
|
|
|
dep_zstd,
|
2020-07-29 06:02:31 +01:00
|
|
|
dep_dl,
|
|
|
|
dep_unwind,
|
2022-07-08 19:16:44 +01:00
|
|
|
dep_futex,
|
2022-02-19 05:19:08 +00:00
|
|
|
idep_mesautilc11
|
2019-09-03 19:43:40 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
if with_platform_android
|
|
|
|
deps_for_libmesa_util += dep_android
|
2020-07-29 06:02:31 +01:00
|
|
|
files_debug_stack = files('u_debug_stack_android.cpp')
|
|
|
|
else
|
|
|
|
files_debug_stack = files(
|
|
|
|
'u_debug_stack.c',
|
|
|
|
'u_debug_symbol.c',
|
|
|
|
'u_debug_symbol.h',
|
|
|
|
)
|
2019-09-03 19:43:40 +01:00
|
|
|
endif
|
|
|
|
|
2021-01-05 04:10:08 +00:00
|
|
|
if with_platform_haiku
|
|
|
|
deps_for_libmesa_util += dep_network
|
|
|
|
endif
|
|
|
|
|
2021-03-22 17:55:35 +00:00
|
|
|
if with_perfetto
|
|
|
|
files_mesa_util += files(
|
2022-08-25 22:26:58 +01:00
|
|
|
'perf/u_perfetto.cc',
|
|
|
|
'perf/u_perfetto.h',
|
2021-03-22 17:55:35 +00:00
|
|
|
)
|
|
|
|
deps_for_libmesa_util += dep_perfetto
|
|
|
|
endif
|
|
|
|
|
2021-05-24 10:11:46 +01:00
|
|
|
u_trace_py = files('perf/u_trace.py')
|
|
|
|
|
2021-11-10 14:57:48 +00:00
|
|
|
u_indices_gen_c = custom_target(
|
|
|
|
'u_indices_gen.c',
|
|
|
|
input : 'indices/u_indices_gen.py',
|
|
|
|
output : 'u_indices_gen.c',
|
2022-10-12 22:32:01 +01:00
|
|
|
command : [prog_python, '@INPUT@', '@OUTPUT@'],
|
2021-11-10 14:57:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
u_unfilled_gen_c = custom_target(
|
|
|
|
'u_unfilled_gen.c',
|
|
|
|
input : 'indices/u_unfilled_gen.py',
|
|
|
|
output : 'u_unfilled_gen.c',
|
2022-10-12 23:25:02 +01:00
|
|
|
command : [prog_python, '@INPUT@', '@OUTPUT@'],
|
2021-11-10 14:57:48 +00:00
|
|
|
)
|
|
|
|
|
2022-06-02 15:02:57 +01:00
|
|
|
libmesa_util_sse41 = static_library(
|
2022-11-04 02:33:47 +00:00
|
|
|
'mesa_util_sse41',
|
|
|
|
files('streaming-load-memcpy.c'),
|
|
|
|
c_args : [c_msvc_compat_args, sse41_args],
|
|
|
|
include_directories : [inc_include, inc_src, inc_mesa],
|
|
|
|
gnu_symbol_visibility : 'hidden',
|
2022-06-02 15:02:57 +01:00
|
|
|
)
|
|
|
|
|
2019-07-22 14:50:15 +01:00
|
|
|
_libmesa_util = static_library(
|
2017-09-15 01:57:17 +01:00
|
|
|
'mesa_util',
|
2021-11-10 14:57:48 +00:00
|
|
|
[files_mesa_util, files_debug_stack, format_srgb, u_indices_gen_c, u_unfilled_gen_c],
|
2019-03-05 16:21:47 +00:00
|
|
|
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
|
2019-09-03 19:43:40 +01:00
|
|
|
dependencies : deps_for_libmesa_util,
|
2022-06-02 15:02:57 +01:00
|
|
|
link_with: [libmesa_format, libmesa_util_sse41],
|
2020-04-24 21:10:41 +01:00
|
|
|
c_args : [c_msvc_compat_args],
|
|
|
|
gnu_symbol_visibility : 'hidden',
|
2017-09-15 01:57:17 +01:00
|
|
|
build_by_default : false
|
|
|
|
)
|
|
|
|
|
2019-07-22 14:50:15 +01:00
|
|
|
idep_mesautil = declare_dependency(
|
|
|
|
link_with : _libmesa_util,
|
2021-07-09 21:19:23 +01:00
|
|
|
include_directories : [inc_util, inc_gallium],
|
2022-11-04 01:57:22 +00:00
|
|
|
dependencies : deps_for_libmesa_util,
|
2019-07-22 14:50:15 +01:00
|
|
|
)
|
|
|
|
|
2022-11-09 20:50:03 +00:00
|
|
|
# Only install the drirc file if we build with support for parsing drirc files
|
|
|
|
if use_xmlconfig
|
|
|
|
install_data(files_drirc, install_dir : join_paths(get_option('datadir'), 'drirc.d'))
|
|
|
|
endif
|
|
|
|
|
2020-09-29 17:37:50 +01:00
|
|
|
xmlconfig_deps = []
|
2022-11-09 19:30:31 +00:00
|
|
|
if use_xmlconfig
|
2020-09-29 17:37:50 +01:00
|
|
|
xmlconfig_deps += dep_expat
|
|
|
|
endif
|
2021-02-24 19:28:38 +00:00
|
|
|
xmlconfig_deps += dep_regex
|
2020-09-29 17:37:50 +01:00
|
|
|
|
2022-11-09 19:30:31 +00:00
|
|
|
c_xmlconfig_arg = '-DWITH_XMLCONFIG=@0@'.format(use_xmlconfig.to_int())
|
|
|
|
|
2019-07-22 15:25:28 +01:00
|
|
|
_libxmlconfig = static_library(
|
2017-09-15 01:57:17 +01:00
|
|
|
'xmlconfig',
|
|
|
|
files_xmlconfig,
|
2019-03-05 16:21:47 +00:00
|
|
|
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
|
2020-09-29 17:37:50 +01:00
|
|
|
dependencies : [idep_mesautil, dep_m, xmlconfig_deps],
|
2018-01-23 18:28:08 +00:00
|
|
|
c_args : [
|
2020-04-24 21:10:41 +01:00
|
|
|
c_msvc_compat_args,
|
2022-11-09 19:23:41 +00:00
|
|
|
c_xmlconfig_arg,
|
2018-01-23 18:28:08 +00:00
|
|
|
'-DSYSCONFDIR="@0@"'.format(
|
|
|
|
join_paths(get_option('prefix'), get_option('sysconfdir'))
|
|
|
|
),
|
2018-08-06 04:41:33 +01:00
|
|
|
'-DDATADIR="@0@"'.format(
|
|
|
|
join_paths(get_option('prefix'), get_option('datadir'))
|
|
|
|
),
|
2018-01-23 18:28:08 +00:00
|
|
|
],
|
2020-04-24 21:10:41 +01:00
|
|
|
gnu_symbol_visibility : 'hidden',
|
2017-09-15 01:57:17 +01:00
|
|
|
build_by_default : false,
|
|
|
|
)
|
|
|
|
|
2019-10-27 00:48:36 +01:00
|
|
|
idep_xmlconfig = declare_dependency(
|
2020-09-29 17:37:50 +01:00
|
|
|
dependencies : xmlconfig_deps,
|
2019-07-22 15:25:28 +01:00
|
|
|
link_with : _libxmlconfig,
|
2019-05-22 16:37:10 +01:00
|
|
|
)
|
|
|
|
|
2020-03-31 22:05:59 +01:00
|
|
|
files_xxd = files('xxd.py')
|
2022-10-17 15:39:03 +01:00
|
|
|
glsl2spirv = files('glsl2spirv.py')
|
2020-03-31 22:05:59 +01:00
|
|
|
|
2017-09-15 01:57:17 +01:00
|
|
|
if with_tests
|
2020-09-25 20:56:22 +01:00
|
|
|
# DRI_CONF macros use designated initializers (required for union
|
|
|
|
# initializaiton), so we need c++2a since gtest forces us to use c++
|
2020-10-06 08:04:57 +01:00
|
|
|
if host_machine.system() != 'windows' and cpp.has_argument('-std=c++2a')
|
2020-09-10 23:13:03 +01:00
|
|
|
test('xmlconfig',
|
|
|
|
executable('xmlconfig_test',
|
|
|
|
files('tests/xmlconfig.cpp'),
|
|
|
|
include_directories : [inc_include, inc_src],
|
|
|
|
dependencies : [idep_mesautil, idep_xmlconfig, idep_gtest],
|
2020-09-25 20:56:22 +01:00
|
|
|
override_options : ['cpp_std=c++2a'],
|
2022-11-09 19:23:41 +00:00
|
|
|
cpp_args: ['-Wno-write-strings', c_xmlconfig_arg]
|
2020-09-10 23:13:03 +01:00
|
|
|
),
|
|
|
|
suite : ['util'],
|
2020-10-07 17:59:43 +01:00
|
|
|
env: ['HOME=' + join_paths(meson.current_source_dir(),
|
|
|
|
'tests', 'drirc_home'),
|
|
|
|
'DRIRC_CONFIGDIR=' + join_paths(meson.current_source_dir(),
|
2021-01-13 21:10:21 +00:00
|
|
|
'tests', 'drirc_configdir')],
|
|
|
|
protocol : gtest_test_protocol,
|
|
|
|
)
|
2020-09-10 23:13:03 +01:00
|
|
|
endif
|
|
|
|
|
2021-10-18 21:16:29 +01:00
|
|
|
files_util_tests = files(
|
2021-10-21 04:53:24 +01:00
|
|
|
'tests/bitset_test.cpp',
|
|
|
|
'tests/blob_test.cpp',
|
2021-10-18 21:16:29 +01:00
|
|
|
'tests/dag_test.cpp',
|
2021-10-18 22:00:14 +01:00
|
|
|
'tests/fast_idiv_by_const_test.cpp',
|
|
|
|
'tests/fast_urem_by_const_test.cpp',
|
2022-04-28 19:38:46 +01:00
|
|
|
'tests/half_float_test.cpp',
|
2021-10-18 21:16:29 +01:00
|
|
|
'tests/int_min_max.cpp',
|
2022-03-31 00:48:50 +01:00
|
|
|
'tests/mesa-sha1_test.cpp',
|
2022-11-10 12:06:14 +00:00
|
|
|
'tests/os_mman_test.cpp',
|
2022-11-03 17:56:34 +00:00
|
|
|
'tests/perf/u_trace_test.cpp',
|
2021-10-21 04:53:24 +01:00
|
|
|
'tests/rb_tree_test.cpp',
|
|
|
|
'tests/register_allocate_test.cpp',
|
|
|
|
'tests/roundeven_test.cpp',
|
2021-10-18 22:00:14 +01:00
|
|
|
'tests/set_test.cpp',
|
2022-03-31 00:48:50 +01:00
|
|
|
'tests/string_buffer_test.cpp',
|
2022-03-30 18:49:12 +01:00
|
|
|
'tests/timespec_test.cpp',
|
2021-10-21 04:53:24 +01:00
|
|
|
'tests/u_atomic_test.cpp',
|
2022-08-31 08:15:00 +01:00
|
|
|
'tests/u_call_once_test.cpp',
|
2021-10-21 04:53:24 +01:00
|
|
|
'tests/u_debug_stack_test.cpp',
|
2022-10-31 21:59:26 +00:00
|
|
|
'tests/u_debug_test.cpp',
|
2022-03-30 19:58:48 +01:00
|
|
|
'tests/u_printf_test.cpp',
|
2021-10-21 04:53:24 +01:00
|
|
|
'tests/u_qsort_test.cpp',
|
2021-10-18 22:00:14 +01:00
|
|
|
'tests/vector_test.cpp',
|
2021-10-18 21:16:29 +01:00
|
|
|
)
|
|
|
|
|
2022-07-28 19:42:42 +01:00
|
|
|
# FIXME: this test cause a big timeout on MacOS
|
|
|
|
if host_machine.system() != 'darwin'
|
|
|
|
files_util_tests += files(
|
|
|
|
'tests/sparse_array_test.cpp',
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
2021-12-03 21:34:08 +00:00
|
|
|
if with_shader_cache
|
|
|
|
files_util_tests += files(
|
|
|
|
'tests/cache_test.cpp',
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
2021-10-18 21:16:29 +01:00
|
|
|
test(
|
|
|
|
'util_tests',
|
|
|
|
executable(
|
|
|
|
'util_tests',
|
|
|
|
files_util_tests,
|
|
|
|
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
|
|
|
|
dependencies : [idep_mesautil, idep_gtest],
|
|
|
|
),
|
|
|
|
suite : ['util'],
|
|
|
|
protocol : gtest_test_protocol,
|
|
|
|
timeout : 180,
|
|
|
|
)
|
2020-07-29 05:29:37 +01:00
|
|
|
|
2020-03-16 09:49:17 +00:00
|
|
|
process_test_exe = executable(
|
|
|
|
'process_test',
|
2021-10-21 04:53:24 +01:00
|
|
|
files('tests/process_test.c'),
|
2019-03-05 16:21:47 +00:00
|
|
|
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
|
2020-03-16 09:49:17 +00:00
|
|
|
dependencies : idep_mesautil,
|
|
|
|
c_args : [c_msvc_compat_args],
|
|
|
|
)
|
2020-04-24 15:06:01 +01:00
|
|
|
if (host_machine.system() == 'windows' and build_machine.system() != 'windows')
|
|
|
|
# This conversion is only required on mingw crosscompilers, otherwise we hit at least one of these issues
|
|
|
|
# https://gitlab.freedesktop.org/mesa/mesa/-/issues/2690
|
|
|
|
# https://gitlab.freedesktop.org/mesa/mesa/-/issues/2788
|
|
|
|
prog_winepath = find_program('winepath')
|
2020-03-16 09:49:17 +00:00
|
|
|
process_test_exe_full_path = run_command(
|
2022-04-06 19:09:27 +01:00
|
|
|
prog_winepath, '-w', process_test_exe.full_path(),
|
|
|
|
check : true
|
2020-03-16 09:49:17 +00:00
|
|
|
).stdout().strip()
|
2020-03-26 13:07:39 +00:00
|
|
|
else
|
|
|
|
process_test_exe_full_path = process_test_exe.full_path()
|
2020-03-16 09:49:17 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
test(
|
|
|
|
'process',
|
|
|
|
process_test_exe,
|
|
|
|
suite : ['util'],
|
|
|
|
env: ['BUILD_FULL_PATH='+process_test_exe_full_path]
|
|
|
|
)
|
|
|
|
|
2017-09-15 01:57:17 +01:00
|
|
|
subdir('tests/hash_table')
|
2018-05-05 01:11:13 +01:00
|
|
|
subdir('tests/vma')
|
2019-11-07 17:33:19 +00:00
|
|
|
subdir('tests/format')
|
2017-09-15 01:57:17 +01:00
|
|
|
endif
|