aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2019-02-12 23:13:24 +0100
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-02-18 15:11:48 -0500
commite50e1fe058f51ac14d4e9130ca1270e3b569cc47 (patch)
tree241c7e66f4fcb4d48377ee0a396039a70dacab34
parentRebase cursor when a layer surface maps (diff)
downloadsway-e50e1fe058f51ac14d4e9130ca1270e3b569cc47.tar.gz
sway-e50e1fe058f51ac14d4e9130ca1270e3b569cc47.tar.zst
sway-e50e1fe058f51ac14d4e9130ca1270e3b569cc47.zip
Fix --version when building from tarball
-rw-r--r--meson.build11
1 files changed, 6 insertions, 5 deletions
diff --git a/meson.build b/meson.build
index c50fab17..2336a148 100644
--- a/meson.build
+++ b/meson.build
@@ -128,12 +128,13 @@ endif
128 128
129add_project_arguments('-DSYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir)), language : 'c') 129add_project_arguments('-DSYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir)), language : 'c')
130 130
131version = '"@0@"'.format(meson.project_version())
131if git.found() 132if git.found()
132 git_commit_hash = run_command([git.path(), 'describe', '--always', '--tags']).stdout().strip() 133 git_commit_hash = run_command([git.path(), 'describe', '--always', '--tags'])
133 git_branch = run_command([git.path(), 'rev-parse', '--abbrev-ref', 'HEAD']).stdout().strip() 134 git_branch = run_command([git.path(), 'rev-parse', '--abbrev-ref', 'HEAD'])
134 version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(git_commit_hash, git_branch) 135 if git_commit_hash.returncode() == 0 and git_branch.returncode() == 0
135else 136 version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(git_commit_hash.stdout().strip(), git_branch.stdout().strip())
136 version = '"@0@"'.format(meson.project_version()) 137 endif
137endif 138endif
138add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c') 139add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c')
139 140