vp-build/common/build-style/cargo.sh
Érico Rolim 2be5dd6156 build-style/cargo: use configure_args in do_check.
Cargo rebuilds the package if the command line arguments aren't the
same, which makes it test the wrong binary.
2020-07-06 09:01:06 +02:00

28 lines
591 B
Bash

#
# This helper is for building rust projects which use cargo for building
#
do_build() {
: ${make_cmd:=cargo}
${make_cmd} build --release --target ${RUST_TARGET} ${configure_args}
}
do_check() {
: ${make_cmd:=cargo}
${make_cmd} test --release --target ${RUST_TARGET} ${configure_args} \
${make_check_args}
}
do_install() {
: ${make_cmd:=cargo}
: ${make_install_args:=--path .}
${make_cmd} install --target ${RUST_TARGET} --root="${DESTDIR}/usr" \
--locked ${configure_args} ${make_install_args}
rm -f "${DESTDIR}"/usr/.crates.toml
rm -f "${DESTDIR}"/usr/.crates2.json
}