meson: Fix building when git isn't available

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/178
This commit is contained in:
Thibault Saunier 2022-04-13 16:37:27 -04:00 committed by Guillaume Desmottes
parent 6855c48488
commit 98174b6cf2

View file

@ -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')