build: Place target in meson build dir

Instead of putting target/ and target_test/ in the source
directory, we can tell our cargo script to put both target
and our cargo-home in meson's build directory.

In addition, makes tests and builds use the same target
directory, significantly reducing the time it takes to run tests.
This commit is contained in:
Christopher Davis
2019-03-07 07:04:23 +02:00
committed by Jordan Petridis
parent 78f29e726e
commit 7a77f31aa3
4 changed files with 9 additions and 12 deletions
+5 -6
View File
@@ -2,11 +2,10 @@
set -ex
export CARGO_HOME=$1/target/cargo-home
export LOCALEDIR="$3"
export APP_ID="$4"
export VERSION="$5"
export PROFILE="$6"
export OUTPUT="$2"
export CARGO_TARGET_DIR="$3"/target
export CARGO_HOME="$CARGO_TARGET_DIR"/cargo-home
export PROFILE="$4"
TARGET=debug
ARGS=()
@@ -23,4 +22,4 @@ if test -d vendor; then
fi
cargo build ${ARGS[@]} --manifest-path="$1"/Cargo.toml -p podcasts-gtk &&
cp $1/target/${TARGET}/podcasts-gtk $2
cp "$CARGO_TARGET_DIR"/${TARGET}/podcasts-gtk "$OUTPUT"
+2 -3
View File
@@ -1,10 +1,9 @@
#! /usr/bin/sh
set -o errexit
set -o nounset
set -o pipefail
export CARGO_HOME="target/cargo-home"
export CARGO_TARGET_DIR="target_test/"
export CARGO_TARGET_DIR="$1/target/"
export CARGO_HOME="$CARGO_TARGET_DIR/cargo-home"
cargo test -j 1 -- --test-threads=1 --nocapture