X-Git-Url: https://code.octet-stream.net/m17rt/blobdiff_plain/23b1648b69b4fa11fdff5f43d704af216c1da401..b894437365797e9cdbccf4b6e6d908180e92ab81:/buildscripts/init.sh 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