Debian Codegraph @

src/bin/pg_dump/meson.build

raw
1 # Copyright (c) 2022-2025, PostgreSQL Global Development Group
2
3 pg_dump_common_sources = files(
4 'compress_gzip.c',
5 'compress_io.c',
6 'compress_lz4.c',
7 'compress_none.c',
8 'compress_zstd.c',
9 'connectdb.c',
10 'dumputils.c',
11 'filter.c',
12 'parallel.c',
13 'pg_backup_archiver.c',
14 'pg_backup_custom.c',
15 'pg_backup_db.c',
16 'pg_backup_directory.c',
17 'pg_backup_null.c',
18 'pg_backup_tar.c',
19 'pg_backup_utils.c',
20 )
21
22 pg_dump_common = static_library('libpgdump_common',
23 pg_dump_common_sources,
24 c_pch: pch_postgres_fe_h,
25 dependencies: [frontend_code, libpq, lz4, zlib, zstd],
26 kwargs: internal_lib_args,
27 )
28
29
30 pg_dump_sources = files(
31 'common.c',
32 'pg_dump.c',
33 'pg_dump_sort.c',
34 )
35
36 if host_system == 'windows'
37 pg_dump_sources += rc_bin_gen.process(win32ver_rc, extra_args: [
38 '--NAME', 'pg_dump',
39 '--FILEDESC', 'pg_dump - backup one PostgreSQL database',])
40 endif
41
42 pg_dump = executable('pg_dump',
43 pg_dump_sources,
44 link_with: [pg_dump_common],
45 dependencies: [frontend_code, libpq, zlib],
46 kwargs: default_bin_args,
47 )
48 bin_targets += pg_dump
49
50
51 pg_dumpall_sources = files(
52 'pg_dumpall.c',
53 )
54
55 if host_system == 'windows'
56 pg_dumpall_sources += rc_bin_gen.process(win32ver_rc, extra_args: [
57 '--NAME', 'pg_dumpall',
58 '--FILEDESC', 'pg_dumpall - backup PostgreSQL databases'])
59 endif
60
61 pg_dumpall = executable('pg_dumpall',
62 pg_dumpall_sources,
63 link_with: [pg_dump_common],
64 dependencies: [frontend_code, libpq, zlib],
65 kwargs: default_bin_args,
66 )
67 bin_targets += pg_dumpall
68
69
70 pg_restore_sources = files(
71 'pg_restore.c',
72 )
73
74 if host_system == 'windows'
75 pg_restore_sources += rc_bin_gen.process(win32ver_rc, extra_args: [
76 '--NAME', 'pg_restore',
77 '--FILEDESC', 'pg_restore - restore PostgreSQL databases'])
78 endif
79
80 pg_restore = executable('pg_restore',
81 pg_restore_sources,
82 link_with: [pg_dump_common],
83 dependencies: [frontend_code, libpq, zlib],
84 kwargs: default_bin_args,
85 )
86 bin_targets += pg_restore
87
88 tests += {
89 'name': 'pg_dump',
90 'sd': meson.current_source_dir(),
91 'bd': meson.current_build_dir(),
92 'tap': {
93 'env': {
94 'GZIP_PROGRAM': gzip.found() ? gzip.path() : '',
95 'LZ4': program_lz4.found() ? program_lz4.path() : '',
96 'ZSTD': program_zstd.found() ? program_zstd.path() : '',
97 'with_icu': icu.found() ? 'yes' : 'no',
98 },
99 'tests': [
100 't/001_basic.pl',
101 't/002_pg_dump.pl',
102 't/003_pg_dump_with_server.pl',
103 't/004_pg_dump_parallel.pl',
104 't/005_pg_dump_filterfile.pl',
105 't/010_dump_connstr.pl',
106 ],
107 },
108 }
109
110 subdir('po', if_found: libintl)