fractal/build-aux/cargo.sh
Veli Tasali 503ff3eadf
build-aux: Move cargo-home to the root of build dir
This avoids rebuilding all the dependencies
everytime in GNOME Builder.

51c3732bea
2021-05-06 19:17:33 +03:00

21 lines
510 B
Bash

#!/bin/sh
export MESON_BUILD_ROOT="$1"
export MESON_SOURCE_ROOT="$2"
export CARGO_TARGET_DIR="$MESON_BUILD_ROOT"/target
export CARGO_HOME="$MESON_BUILD_ROOT"/cargo-home
if [[ $4 = "Devel" ]]
then
echo "DEBUG MODE"
cargo build --manifest-path \
"$MESON_SOURCE_ROOT"/Cargo.toml && \
cp "$CARGO_TARGET_DIR"/debug/$5 $3
else
echo "RELEASE MODE"
cargo build --manifest-path \
"$MESON_SOURCE_ROOT"/Cargo.toml --release && \
cp "$CARGO_TARGET_DIR"/release/$5 $3
fi