]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: Generate the version number
authorFred Morcos <fred.morcos@open-xchange.com>
Thu, 3 Aug 2023 17:06:15 +0000 (19:06 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:31 +0000 (13:28 +0100)
meson.build
meson/version/meson.build [new file with mode: 0644]

index e1b58da3abc5aa358b87a9b529ab9b6682e6dd2a..034720b024e956d62f45297aacf651c2fdedd8d2 100644 (file)
@@ -2,7 +2,7 @@ project(
   'pdns',
   ['c', 'cpp'],
   # version: 4.7.0,             # TODO This should call builder-support/gen-version
-  # license_files: 'LICENse',   # TODO Meson 1.1.0
+  # license_files: 'LICENSE',   # TODO Meson 1.1.0
   meson_version: '>= 0.53',
   default_options: [
     'buildtype=debugoptimized',
@@ -21,6 +21,7 @@ fs = import('fs')
 conf = configuration_data()
 deps = []
 
+subdir('meson/version')                  # Generate version define
 subdir('meson/compiler-setup')           # Common compiler setup (cxx is the C++ compiler)
 subdir('meson/summary')                  # Print a system/project summary
 subdir('meson/timet-size')               # Check the size of time_t
diff --git a/meson/version/meson.build b/meson/version/meson.build
new file mode 100644 (file)
index 0000000..745586b
--- /dev/null
@@ -0,0 +1,9 @@
+# Generate version define
+# Inputs: conf
+
+# TODO Find a way to fix these ../.. because meson.current_source_dir() returns
+# $GIT_ROOT/meson/version. Meson 0.56 introduces meson.project_source_root().
+gen_version_prog = find_program('gen-version', dirs: meson.current_source_dir() / '..' / '..' / 'builder-support', required: true)
+gen_version_prog_res = run_command(gen_version_prog, check: true)
+version = gen_version_prog_res.stdout().strip()
+conf.set_quoted('VERSION', version, description: 'Version')