1#!/bin/sh
2# SPDX-License-Identifier: LGPL-2.1-or-later
3set -eux
4
5src="$1"
6dst="$2"
7target="$3"
8options="$4"
9CC="$5"
10CXX="$6"
11
12# shellcheck disable=SC2086
13[ -f "$dst/ninja.build" ] || CC="$CC" CXX="$CXX" meson "$src" "$dst" $options
14
15# Locate ninja binary, on CentOS 7 it is called ninja-build, so
16# use that name if available.
17ninja="ninja"
18if which ninja-build >/dev/null 2>&1 ; then
19    ninja="ninja-build"
20fi
21
22"$ninja" -C "$dst" "$target"
23