X-Git-Url: https://code.octet-stream.net/m17rt/blobdiff_plain/a5a74cad40908537ed67ba5cf29f8743cbccc4c4..1f1869d3e36f7192892fad069ef159faba208ccd:/buildscripts/init.sh?ds=inline diff --git a/buildscripts/init.sh b/buildscripts/init.sh new file mode 100644 index 0000000..ed73ec8 --- /dev/null +++ b/buildscripts/init.sh @@ -0,0 +1,32 @@ +#!/bin/bash +set -euxo pipefail +cd "$(git rev-parse --show-toplevel)" + +PLATFORM=$1 + +case $PLATFORM in +mac-x86_64) + RUST_TARGET=x86_64-apple-darwin + ;; +mac-arm64) + RUST_TARGET=aarch64-apple-darwin + ;; +linux-x86_64) + RUST_TARGET=x86_64-unknown-linux-gnu + ;; +linux-armhf) + RUST_TARGET=armv7-unknown-linux-gnueabihf + ;; +linux-arm64) + RUST_TARGET=aarch64-unknown-linux-gnu + ;; +windows-x86_64) + RUST_TARGET=x86_64-pc-windows-msvc + ;; +*) + echo "Unrecognised platform" + exit 1 + ;; +esac + +export RUST_TARGET