Skip to content

Commit eab5ff8

Browse files
committed
chore: Adds script to cross compile faucet
1 parent 467a1f4 commit eab5ff8

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

cross.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
# This is a script to cross-compile the project for Windows and Linux
4+
mkdir -p target/cross
5+
6+
rustup target add aarch64-unknown-linux-musl
7+
rustup target add x86_64-unknown-linux-musl
8+
rustup target add x86_64-pc-windows-gnu
9+
10+
function build() {
11+
export TARGET=$1
12+
export EXTENSION=$2
13+
echo "Building for $TARGET"
14+
cross build --release --target $TARGET
15+
mv target/$TARGET/release/faucet$EXTENSION target/cross/faucet-$TARGET$EXTENSION
16+
sha256sum target/cross/faucet-$TARGET$EXTENSION > target/cross/faucet-$TARGET$EXTENSION.sha256
17+
}
18+
19+
# Build for Linux
20+
build aarch64-unknown-linux-musl
21+
build x86_64-unknown-linux-musl
22+
23+
# Build for Windows
24+
build x86_64-pc-windows-gnu .exe

0 commit comments

Comments
 (0)