-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Adds script to cross compile faucet
- Loading branch information
1 parent
467a1f4
commit eab5ff8
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |