[gnome-music/wip/jfelder/meson-git-optional: 9/9] meson: Check git program presence



commit 1a1bdb3cc4e9c1528dc10ecc04e8f68d86d0f942
Author: Jean Felder <jfelder src gnome org>
Date:   Sat Aug 4 15:44:30 2018 +0200

    meson: Check git program presence
    
    If git cannot be found, do not try to get the latest git commit hash.
    
    Closes: #211

 data/meson.build | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/data/meson.build b/data/meson.build
index c4f49e5b..23e0c7e6 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -1,5 +1,9 @@
 # Compiling the resources
-VCS_TAG = run_command('git', 'rev-parse', '--short', 'HEAD').stdout().strip()
+VCS_TAG = ''
+git = find_program('git', required : false)
+if git.found()
+  VCS_TAG = run_command('git', 'rev-parse', '--short', 'HEAD').stdout().strip()
+endif
 if VCS_TAG == ''
   if get_option('profile') != 'default'
     VCS_TAG = 'devel'


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]