summaryrefslogtreecommitdiff
path: root/examples/meson.build
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-07-09 21:22:16 +0200
committerDavid Härdeman <david@hardeman.nu>2020-07-09 21:22:16 +0200
commit984f586e3ef70b9db759ce48da4f06f0a6680c6f (patch)
tree3fe76aa0140255aab9bb08f21615ea7ada150796 /examples/meson.build
parentdd6321c0acf7b0570811200a205cc4104bee49c7 (diff)
Move example config files to external files and generate at build time
Diffstat (limited to 'examples/meson.build')
-rw-r--r--examples/meson.build29
1 files changed, 29 insertions, 0 deletions
diff --git a/examples/meson.build b/examples/meson.build
new file mode 100644
index 0000000..e50f459
--- /dev/null
+++ b/examples/meson.build
@@ -0,0 +1,29 @@
+# SPDX-License-Identifier: GPL-2
+
+example_files = [
+ 'eula.txt',
+ 'example.mcserver',
+ 'minecproxy.conf',
+ 'minecproxy.service',
+ 'minecserver@.service',
+ 'README.TXT',
+ 'server.properties',
+]
+
+xxd = find_program('xxd')
+
+xxd_cmd = [xxd, '-i', '@INPUT@', '@OUTPUT@']
+
+foreach example_file: example_files
+ example_output = example_file + '.h'
+
+ file = custom_target(
+ example_output,
+ input: example_file,
+ output: example_output,
+ command: xxd_cmd,
+ build_by_default: true,
+ )
+endforeach
+
+