From b2ba94645c3b6432f77595bc119c9fa9f3d3706c Mon Sep 17 00:00:00 2001 From: tfuxu <73042332+tfuxu@users.noreply.github.com> Date: Sat, 18 Mar 2023 17:29:36 +0000 Subject: [PATCH] meson: don't fail if host doesn't have `git` installed Signed-off-by: tfuxu <73042332+tfuxu@users.noreply.github.com> --- meson.build | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 30e17a1b..cc6d1889 100644 --- a/meson.build +++ b/meson.build @@ -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