From 1403ebb90c85b8f9f413bee413369b5bdb546b5f Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Thu, 9 Feb 2023 13:27:20 -0800
Subject: [PATCH v2 5/5] pg_bsd_indent: build under meson

---
 src/meson.build                     |  2 ++
 src/tools/pg_bsd_indent/meson.build | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 src/tools/pg_bsd_indent/meson.build

diff --git a/src/meson.build b/src/meson.build
index 80fd2823a98..bceeca70f90 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -13,6 +13,8 @@ subdir('pl')
 
 subdir('interfaces')
 
+subdir('tools/pg_bsd_indent')
+
 
 ### Generate a Makefile.global that's complete enough for PGXS to work.
 #
diff --git a/src/tools/pg_bsd_indent/meson.build b/src/tools/pg_bsd_indent/meson.build
new file mode 100644
index 00000000000..4c2ae20a461
--- /dev/null
+++ b/src/tools/pg_bsd_indent/meson.build
@@ -0,0 +1,25 @@
+# Copyright (c) 2022-2023, PostgreSQL Global Development Group
+
+pg_bsd_indent_sources = files(
+  'args.c',
+  'err.c',
+  'indent.c',
+  'io.c',
+  'lexi.c',
+  'parse.c',
+  'pr_comment.c',
+)
+
+if host_system == 'windows'
+  pg_bsd_indent_sources += rc_bin_gen.process(win32ver_rc, extra_args: [
+    '--NAME', 'pg_bsd_indent',
+    '--FILEDESC', 'pg_bsd_indent - indent C code nicely'])
+endif
+
+pg_bsd_indent = executable('pg_bsd_indent',
+  pg_bsd_indent_sources,
+  dependencies: [frontend_code],
+  include_directories: include_directories('.'),
+  kwargs: default_bin_args,
+)
+bin_targets += pg_bsd_indent
-- 
2.38.0

