Files
squeekboard/cargo.sh
Dorota Czaplejewicz 3413021d30 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.
2019-08-30 09:00:34 +00:00

15 lines
218 B
Bash

#!/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