mirror of
https://github.com/rizinorg/rizin.git
synced 2026-10-12 02:21:57 +00:00
55 lines
1.3 KiB
Meson
55 lines
1.3 KiB
Meson
# SPDX-FileCopyrightText: 2025
|
|
# SPDX-License-Identifier: LGPL-3.0-only
|
|
|
|
if get_option('enable_benchmarks')
|
|
# Build utility library for benchmarks
|
|
bench_utils = static_library('bench_utils',
|
|
'bench_utils.c',
|
|
include_directories: [platform_inc],
|
|
dependencies: [
|
|
rz_util_dep,
|
|
rz_il_dep
|
|
],
|
|
)
|
|
|
|
bench_utils_dep = declare_dependency(
|
|
link_with: bench_utils,
|
|
include_directories: [include_directories('.')],
|
|
)
|
|
|
|
# List of benchmarks to build
|
|
benchmarks = [
|
|
'bitvector',
|
|
'diff',
|
|
'graph',
|
|
'il',
|
|
'ht',
|
|
'util',
|
|
'vector',
|
|
'list',
|
|
'core_analysis'
|
|
]
|
|
|
|
# Create benchmark executables
|
|
foreach bench : benchmarks
|
|
exe = executable('bench_@0@'.format(bench),
|
|
'bench_@[email protected]'.format(bench),
|
|
include_directories: [platform_inc, '.'],
|
|
dependencies: [
|
|
bench_utils_dep,
|
|
rz_util_dep,
|
|
rz_diff_dep,
|
|
rz_core_dep,
|
|
rz_config_dep,
|
|
],
|
|
install: false,
|
|
implicit_include_directories: false,
|
|
)
|
|
|
|
# Register with meson test system (run with: meson test --benchmark)
|
|
benchmark(bench, exe, suite: 'bench', timeout: 1024)
|
|
endforeach
|
|
|
|
message('Benchmarks enabled - build with "meson compile" and run with "meson test --benchmark"')
|
|
endif
|