oss-fuzz: Fallback to ninja-build when available (#8641)

The ninja binary is deployed as `ninja-build` in older distros such as
RHEL 7/CentOS 7.  Detect that and use `ninja-build` instead of `ninja`
when it's available.
This commit is contained in:
Filipe Brandenburger 2018-04-04 00:32:59 -07:00 committed by Zbigniew Jędrzejewski-Szmek
parent 68b04721dc
commit 63554ed907

View file

@ -7,4 +7,12 @@ target="$3"
options="$4"
[ -d "$dst" ] || meson "$src" "$dst" $options
ninja -C "$dst" "$target"
# Locate ninja binary, on CentOS 7 it is called ninja-build, so
# use that name if available.
ninja=ninja
if which ninja-build >/dev/null 2>&1 ; then
ninja=ninja-build
fi
"$ninja" -C "$dst" "$target"