mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-10-29 22:25:39 +00:00
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 <eschwartz@gentoo.org>
This commit is contained in:
1 file changed
+1
-1
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
project('zoitechat', 'c',
|
project('zoitechat', 'c',
|
||||||
version: run_command('cat', 'VERSION', check: true).stdout().strip(),
|
version: files('VERSION'),
|
||||||
meson_version: '>= 0.59.0',
|
meson_version: '>= 0.59.0',
|
||||||
default_options: [
|
default_options: [
|
||||||
'c_std=c17',
|
'c_std=c17',
|
||||||
|
|||||||
Reference in new issue
Block a user