diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2024-03-13 18:33:59 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2024-03-13 18:40:57 +0100 |
commit | d5dd917a02ce2ae5ae0fa2c2817bb8cc0a675cf5 (patch) | |
tree | c9e57644cc4b5d4d36fd2613aff98937dc1b6c47 /meson.build | |
parent | meson: .git can also be a file (diff) | |
download | systemd-d5dd917a02ce2ae5ae0fa2c2817bb8cc0a675cf5.tar.xz systemd-d5dd917a02ce2ae5ae0fa2c2817bb8cc0a675cf5.zip |
meson: always use vcs_tag
The branch with configure_file() was broken: meson doesn't know that
this file is a prerequisite for other targets, so partial rebuilds were broken.
Easy reproducer:
git mv .git{,.no}
touch meson build && ninja -C build src/basic/libbasic.a
rm build/version.h
ninja -C build src/basic/libbasic.a
Using vcs_tag() also in that case makes meson always build the file.
(Combined with the issue fixed in previous commit, I was encountering
failed builds quite often.)
Fixes 3f6ce3d4f04de0f765bb3bde0e400d0823829486.
Diffstat (limited to '')
-rw-r--r-- | meson.build | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/meson.build b/meson.build index ddda3d7181..078ba822ea 100644 --- a/meson.build +++ b/meson.build @@ -1853,20 +1853,15 @@ endif conf.set_quoted('VERSION_TAG', version_tag) vcs_tag = get_option('vcs-tag') -if vcs_tag and fs.exists(project_source_root / '.git') - version_h = vcs_tag( - input : 'src/version/version.h.in', - output : 'version.h', - fallback : '', - command : ['sh', '-c', 'echo "-g$(git -C . describe --abbrev=7 --match="" --always --dirty=^)"'], - ) -else - version_h = configure_file( - input : 'src/version/version.h.in', - output : 'version.h', - configuration : configuration_data({'VCS_TAG' : ''}), - ) -endif +command = ['sh', '-c', + vcs_tag and fs.exists(project_source_root / '.git') ? + 'echo "-g$(git -C . describe --abbrev=7 --match="" --always --dirty=^)"' : ':'] +version_h = vcs_tag( + input : 'src/version/version.h.in', + output : 'version.h', + fallback : '', + command : command, +) shared_lib_tag = get_option('shared-lib-tag') if shared_lib_tag == '' |