Merge pull request #3667 from emersion/fix-meson-version

Fix --version when building from tarball
master
Drew DeVault 6 years ago committed by GitHub
commit f390a6ef8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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')
if git.found()
git_commit_hash = run_command([git.path(), 'describe', '--always', '--tags']).stdout().strip()
git_branch = run_command([git.path(), 'rev-parse', '--abbrev-ref', 'HEAD']).stdout().strip()
version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(git_commit_hash, git_branch)
else
version = '"@0@"'.format(meson.project_version()) version = '"@0@"'.format(meson.project_version())
if git.found()
git_commit_hash = run_command([git.path(), 'describe', '--always', '--tags'])
git_branch = run_command([git.path(), 'rev-parse', '--abbrev-ref', 'HEAD'])
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())
endif
endif endif
add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c') add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c')

Loading…
Cancel
Save