mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-02-02 09:47:03 +03:00
6a2541eb27
Prompted by #29972, because right now it's practically impossible to pass -fno-sanitize=function to the fuzzer targets without some extensive sed'ing. This splits both c_args and cpp_args to separate arguments for tools/meson-build.sh, because the other way would be to use `eval`, so the space-separated but quoted strings passed to these options are not split where they shouldn't, and I'd rather avoid using `eval` if possible. Also, this switches the positional arguments we pass to `meson setup`, as they were in incorrect order (docs say it should be buildir followed by sourcedir); meson is apparently clever enough to figure this out and switch the arguments around if necessary, so it didn't complain. (cherry picked from commit 17ee59c9c922553a8cb4d54cb8ae415706c4feff)
22 lines
585 B
Bash
Executable File
22 lines
585 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"
|