From dc4d6203a508525b8df196f9c3a1d8d11b94d283 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Tue, 27 Oct 2026 12:16:11 -0400 Subject: [PATCH] meson: extract the version directly from ./VERSION without subprocesses With the new minimum meson_version, it is possible to retrieve the project version from a file by passing a files() output directly to the version argument. It is no longer necessary to call run_command with various arguments to configure its behavior, nor depend on a system /usr/bin/cat (which admittedly does exist on non-Windows systems). And meson will also treat the VERSION file as a build input, and reconfigure the build if it changes -- meaning that the built binaries are updated to have the correct version number (configure_file, PACKAGE_VERSION, etc). Signed-off-by: Eli Schwartz --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index ae0bde79..d29af737 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('zoitechat', 'c', - version: run_command('cat', 'VERSION', check: true).stdout().strip(), + version: files('VERSION'), meson_version: '>= 0.59.0', default_options: [ 'c_std=c17',