| 1 |
# Copyright (c) 2022-2025, PostgreSQL Global Development Group |
| 2 |
|
| 3 |
pgbench_sources = files( |
| 4 |
'pgbench.c', |
| 5 |
) |
| 6 |
|
| 7 |
exprscan = custom_target('exprscan', |
| 8 |
input: 'exprscan.l', |
| 9 |
output: 'exprscan.c', |
| 10 |
command: flex_cmd, |
| 11 |
) |
| 12 |
generated_sources += exprscan |
| 13 |
pgbench_sources += exprscan |
| 14 |
|
| 15 |
exprparse = custom_target('exprparse', |
| 16 |
input: 'exprparse.y', |
| 17 |
kwargs: bison_kw, |
| 18 |
) |
| 19 |
generated_sources += exprparse.to_list() |
| 20 |
pgbench_sources += exprparse |
| 21 |
|
| 22 |
if host_system == 'windows' |
| 23 |
pgbench_sources += rc_bin_gen.process(win32ver_rc, extra_args: [ |
| 24 |
'--NAME', 'pgbench', |
| 25 |
'--FILEDESC', 'pgbench - a simple program for running benchmark tests']) |
| 26 |
endif |
| 27 |
|
| 28 |
pgbench = executable('pgbench', |
| 29 |
pgbench_sources, |
| 30 |
dependencies: [frontend_code, libpq, thread_dep], |
| 31 |
include_directories: include_directories('.'), |
| 32 |
c_pch: pch_postgres_fe_h, |
| 33 |
c_args: host_system == 'windows' ? ['-DFD_SETSIZE=1024'] : [], |
| 34 |
kwargs: default_bin_args, |
| 35 |
) |
| 36 |
bin_targets += pgbench |
| 37 |
|
| 38 |
tests += { |
| 39 |
'name': 'pgbench', |
| 40 |
'sd': meson.current_source_dir(), |
| 41 |
'bd': meson.current_build_dir(), |
| 42 |
'tap': { |
| 43 |
'tests': [ |
| 44 |
't/001_pgbench_with_server.pl', |
| 45 |
't/002_pgbench_no_server.pl', |
| 46 |
], |
| 47 |
}, |
| 48 |
} |