Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederik Delaere committed Mar 5, 2018
2 parents 8fdd85a + d960074 commit 37c9381
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions build_static.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
#!/bin/bash

TOOLCHAIN="x86_64-unknown-linux-musl"
# first add the target:
if [ "`rustup show | \grep $TOOLCHAIN`" != "$TOOLCHAIN" ]; then
rustup target add x86_64-unknown-linux-musl
if [ "$(uname)" == "Darwin" ]; then
cargo build --release
strip target/release/rsmodules
cp target/release/rsmodules .
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
TOOLCHAIN="x86_64-unknown-linux-musl"
# first add the target:
if [ "`rustup show | \grep $TOOLCHAIN`" != "$TOOLCHAIN" ]; then
rustup target add x86_64-unknown-linux-musl
fi
# then build
cargo build --release --target=$TOOLCHAIN
strip target/$TOOLCHAIN/release/rsmodules
cp target/$TOOLCHAIN/release/rsmodules .
fi

# then build
cargo build --release --target=$TOOLCHAIN
strip target/$TOOLCHAIN/release/rsmodules
cp target/$TOOLCHAIN/release/rsmodules .

0 comments on commit 37c9381

Please sign in to comment.