meson: don't fail if host doesn't have git installed

Signed-off-by: tfuxu <73042332+tfuxu@users.noreply.github.com>
This commit is contained in:
tfuxu 2023-03-18 17:29:36 +00:00 committed by GitHub
parent eb9626f8f7
commit b2ba94645c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,9 +20,15 @@ TRANSLATE_URL = 'https://hosted.weblate.org/projects/GradienceTeam/gradience'
# Constants
PROJECT_RDNN_NAME = 'com.github.GradienceTeam.Gradience'
git_bin = find_program('git', required: false)
# Set APPLICATION_ID and VERSION_SUFFIX
if get_option('buildtype') == 'debug'
VCS_TAG = run_command('git', 'rev-parse', '--short', 'HEAD', check: true).stdout().strip()
if git_bin.found()
VCS_TAG = run_command('git', 'rev-parse', '--short', 'HEAD', check: true).stdout().strip()
else
VCS_TAG = ''
endif
if VCS_TAG == ''
VERSION_SUFFIX = '-devel'
else