meson: fix snapshot builds

Previously, is git was found but the build was run from a snapshot,
`version` wouldn't be set. This commit fixes this by first setting
version to the project version and only then, conditionally, setting it
to the git version.

Fixes #125.
This commit is contained in:
Jente Hidskes 2020-02-17 19:34:54 +01:00
parent 42782bda1d
commit 6fa2734651
No known key found for this signature in database
GPG key ID: 04BE5A29F32D91EA

View file

@ -75,6 +75,7 @@ else
have_xwayland = false
endif
version = '@0@'.format(meson.project_version())
git = find_program('git', native: true, required: false)
if git.found()
git_commit = run_command([git, 'rev-parse', '--short', 'HEAD'])
@ -86,8 +87,6 @@ if git.found()
git_branch.stdout().strip(),
)
endif
else
version = '@0@'.format(meson.project_version())
endif
conf_data = configuration_data()