Skip to content

Commit

Permalink
chore: Adds script to cross compile faucet
Browse files Browse the repository at this point in the history
  • Loading branch information
andyquinterom committed Jan 16, 2024
1 parent 467a1f4 commit eab5ff8
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cross.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

# This is a script to cross-compile the project for Windows and Linux
mkdir -p target/cross

rustup target add aarch64-unknown-linux-musl
rustup target add x86_64-unknown-linux-musl
rustup target add x86_64-pc-windows-gnu

function build() {
export TARGET=$1
export EXTENSION=$2
echo "Building for $TARGET"
cross build --release --target $TARGET
mv target/$TARGET/release/faucet$EXTENSION target/cross/faucet-$TARGET$EXTENSION
sha256sum target/cross/faucet-$TARGET$EXTENSION > target/cross/faucet-$TARGET$EXTENSION.sha256
}

# Build for Linux
build aarch64-unknown-linux-musl
build x86_64-unknown-linux-musl

# Build for Windows
build x86_64-pc-windows-gnu .exe

0 comments on commit eab5ff8

Please sign in to comment.