diff options
-rw-r--r-- | meson.build | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/meson.build b/meson.build index 87a513c..0620758 100644 --- a/meson.build +++ b/meson.build @@ -40,10 +40,14 @@ scdoc = find_program('scdoc', required: get_option('man-pages'), native: true) version = '"@0@"'.format(meson.project_version()) if git.found() - git_commit_hash = run_command([git, 'describe', '--always', '--tags'], check: false) + git_commit = run_command([git, 'rev-parse', '--short', 'HEAD'], check: false) git_branch = run_command([git, 'rev-parse', '--abbrev-ref', 'HEAD'], check: false) - if git_commit_hash.returncode() == 0 and git_branch.returncode() == 0 - version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(git_commit_hash.stdout().strip(), git_branch.stdout().strip()) + if git_commit.returncode() == 0 and git_branch.returncode() == 0 + version = '"@0@-@1@ (" __DATE__ ", branch \'@2@\')"'.format( + meson.project_version(), + git_commit.stdout().strip(), + git_branch.stdout().strip(), + ) endif endif |