From 98174b6cf22463d17f77d9d3dcd2059217efdb63 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 13 Apr 2022 16:37:27 -0400 Subject: [PATCH] meson: Fix building when git isn't available Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/178 --- meson.build | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 75b8a6ec..dbe3bad8 100644 --- a/meson.build +++ b/meson.build @@ -177,9 +177,16 @@ plugins_install_dir = get_option('libdir') / 'gstreamer-1.0' pkgconfig_install_dir = get_option('libdir') / 'pkgconfig' # Use all files checked in git to figure out when to rebuild -tmp = run_command(['git', 'ls-files', '.']) -files = tmp.stdout().split() -if tmp.returncode() == 0 and files.length() > 0 +git = find_program('git', required: false) +files = [] +if git.found() + tmp = run_command([git, 'ls-files', '.']) + if tmp.returncode() == 0 + files = tmp.stdout().split() + endif +endif + +if files.length() > 0 build_always_stale = false else warning('Could not retrieve list of files, always building the target')