mirror of
https://github.com/systemd/systemd
synced 2024-09-06 08:46:19 +00:00
![Frantisek Sumsal](/assets/img/avatar_default.png)
meson's `cpp_args` option is defined only if it detects a C++ compiler, otherwise we get an error: ../test/fuzz/meson.build:56:28: ERROR: Tried to access unknown option 'cpp_args'.
22 lines
581 B
Bash
Executable file
22 lines
581 B
Bash
Executable file
#!/bin/sh
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
set -eux
|
|
|
|
sourcedir="${1:?}"
|
|
builddir="${2:?}"
|
|
target="${3:?}"
|
|
c_args="${4:?}"
|
|
cpp_args="${5:?}"
|
|
options="${6:?}"
|
|
CC="${7:?}"
|
|
CXX="$8"
|
|
|
|
if [ ! -f "$builddir/build.ninja" ]; then
|
|
# shellcheck disable=SC2086
|
|
CC="$CC" CXX="$CXX" meson setup -Dc_args="$c_args" -Dcpp_args="$cpp_args" "$builddir" "$sourcedir" $options
|
|
fi
|
|
|
|
# Locate ninja binary, on CentOS 7 it is called ninja-build, so use that name if available.
|
|
command -v ninja-build >/dev/null && ninja="ninja-build" || ninja="ninja"
|
|
"$ninja" -C "$builddir" "$target"
|