aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/psql/meson.build')
-rw-r--r--src/bin/psql/meson.build67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/bin/psql/meson.build b/src/bin/psql/meson.build
new file mode 100644
index 00000000000..ea850c8fdf5
--- /dev/null
+++ b/src/bin/psql/meson.build
@@ -0,0 +1,67 @@
+psql_sources = files(
+ 'command.c',
+ 'common.c',
+ 'copy.c',
+ 'crosstabview.c',
+ 'describe.c',
+ 'help.c',
+ 'input.c',
+ 'large_obj.c',
+ 'mainloop.c',
+ 'prompt.c',
+ 'startup.c',
+ 'stringutils.c',
+ 'tab-complete.c',
+ 'variables.c',
+)
+
+psqlscanslash = custom_target('psqlscanslash',
+ input: 'psqlscanslash.l',
+ output: 'psqlscanslash.c',
+ command: [flex_cmd, '--no-backup', '--fix-warnings', '--', '-Cfe', '-p', '-p'])
+generated_sources += psqlscanslash
+psql_sources += psqlscanslash
+bin_targets += psqlscanslash
+
+sql_help = custom_target('psql_help',
+ output: ['sql_help.c', 'sql_help.h'],
+ depfile: 'sql_help.dep',
+ command: [
+ perl, files('create_help.pl'),
+ '--docdir', '@SOURCE_ROOT@/doc/src/sgml/ref',
+ '--depfile', '@DEPFILE@',
+ '--outdir', '@OUTDIR@',
+ '--basename', 'sql_help',
+ ],
+)
+generated_sources += sql_help.to_list()
+psql_sources += sql_help
+bin_targets += sql_help
+
+psql = executable('psql',
+ psql_sources,
+ include_directories: include_directories('.'),
+ dependencies: [frontend_code, libpq, readline],
+ kwargs: default_bin_args,
+)
+bin_targets += psql
+
+install_data('psqlrc.sample',
+ install_dir: dir_data,
+)
+
+tests += {
+ 'name': 'psql',
+ 'sd': meson.current_source_dir(),
+ 'bd': meson.current_build_dir(),
+ 'tap': {
+ 'env': {'with_readline': readline.found() ? 'yes' : 'no'},
+ 'tests': [
+ 't/001_basic.pl',
+ 't/010_tab_completion.pl',
+ 't/020_cancel.pl',
+ ],
+ },
+}
+
+subdir('po', if_found: libintl)