cargo: Allow for manual cargo invokations

This commit is contained in:
Dorota Czaplejewicz
2019-09-10 10:15:25 +00:00
parent 04a47ad0af
commit c725cd7f14
2 changed files with 21 additions and 3 deletions

View File

@ -1,13 +1,22 @@
#!/bin/sh
#!/bin/bash
# This script manages Cargo operations
# while keeping the artifact directory within the build tree
# instead of the source tree
set -e
SOURCE_DIR="$1"
export CARGO_TARGET_DIR=`pwd`
if [ ! -z ${2} ]; then
OUT_PATH=`realpath "${2}"`
fi
cd $1
cargo $3 -p rs
cd $SOURCE_DIR
shift
shift
cargo $BUILD_ARG $@
if [ ! -z ${OUT_PATH} ]; then
cp "${CARGO_TARGET_DIR}"/debug/librs.a "${OUT_PATH}"