nixpkgs/pkgs/development/tools/build-managers/meson/setup-hook.sh
2018-03-22 07:33:49 +01:00

53 lines
1.4 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mesonConfigurePhase() {
runHook preConfigure
if [ -z "$dontAddPrefix" ]; then
mesonFlags="--prefix=$prefix $mesonFlags"
fi
# Build release by default.
if [ -n "@isCross@" ]; then
crossMesonFlags="--cross-file=@crossFile@/cross-file.conf"
fi
# See multiple-outputs.sh and mesons coredata.py
mesonFlags="\
--libdir=${!outputLib}/lib --libexecdir=${!outputLib}/libexec \
--bindir=${!outputBin}/bin --sbindir=${!outputBin}/sbin \
--includedir=${!outputInclude}/include \
--mandir=${!outputMan}/share/man --infodir=${!outputInfo}/share/info \
--localedir=${!outputLib}/share/locale \
$mesonFlags"
mesonFlags="${crossMesonFlags+$crossMesonFlags }--buildtype=${mesonBuildType:-release} $mesonFlags"
echo "meson flags: $mesonFlags ${mesonFlagsArray[@]}"
CC=@cc@/bin/cc CXX=@cc@/bin/c++ meson build $mesonFlags "${mesonFlagsArray[@]}"
cd build
if ! [[ -v enableParallelBuilding ]]; then
enableParallelBuilding=1
echo "meson: enabled parallel building"
fi
runHook postConfigure
}
if [ -z "$dontUseMesonConfigure" -a -z "$configurePhase" ]; then
setOutputFlags=
configurePhase=mesonConfigurePhase
fi
mesonCheckPhase() {
runHook preCheck
meson test --print-errorlogs
runHook postCheck
}
if [ -z "$dontUseMesonCheck" -a -z "$checkPhase" ]; then
checkPhase=mesonCheckPhase
fi