rust: Use Cargo to build the Rust portion

Pros: Ability to use Rust libraries from crates.io
Problems: Need to lock library versions and document their reproducible building, either via Cargo.lock or vendoring.
This commit is contained in:
Dorota Czaplejewicz
2019-08-29 15:34:42 +00:00
parent 09deef2d6c
commit 3413021d30
6 changed files with 43 additions and 14 deletions

14
cargo.sh Normal file
View File

@ -0,0 +1,14 @@
#!/bin/sh
set -e
export CARGO_TARGET_DIR=`pwd`
if [ ! -z ${2} ]; then
OUT_PATH=`realpath "${2}"`
fi
cd $1
cargo $3 -p rs
if [ ! -z ${OUT_PATH} ]; then
cp "${CARGO_TARGET_DIR}"/debug/librs.a "${OUT_PATH}"
fi