mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
Merge pull request #3667 from emersion/fix-meson-version
Fix --version when building from tarball
This commit is contained in:
commit
f390a6ef8c
1 changed files with 6 additions and 5 deletions
11
meson.build
11
meson.build
|
@ -128,12 +128,13 @@ endif
|
||||||
|
|
||||||
add_project_arguments('-DSYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir)), language : 'c')
|
add_project_arguments('-DSYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir)), language : 'c')
|
||||||
|
|
||||||
|
version = '"@0@"'.format(meson.project_version())
|
||||||
if git.found()
|
if git.found()
|
||||||
git_commit_hash = run_command([git.path(), 'describe', '--always', '--tags']).stdout().strip()
|
git_commit_hash = run_command([git.path(), 'describe', '--always', '--tags'])
|
||||||
git_branch = run_command([git.path(), 'rev-parse', '--abbrev-ref', 'HEAD']).stdout().strip()
|
git_branch = run_command([git.path(), 'rev-parse', '--abbrev-ref', 'HEAD'])
|
||||||
version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(git_commit_hash, git_branch)
|
if git_commit_hash.returncode() == 0 and git_branch.returncode() == 0
|
||||||
else
|
version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(git_commit_hash.stdout().strip(), git_branch.stdout().strip())
|
||||||
version = '"@0@"'.format(meson.project_version())
|
endif
|
||||||
endif
|
endif
|
||||||
add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c')
|
add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue