From d9600742b9439c4d3b932d885cfe5671dd1de96f Mon Sep 17 00:00:00 2001 From: Frederik Delaere Date: Sat, 3 Mar 2018 08:05:17 +0100 Subject: [PATCH] build_static.sh now builds on macos too, but only a release build, not a static one --- build_static.sh | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/build_static.sh b/build_static.sh index 88353c1..670b44f 100755 --- a/build_static.sh +++ b/build_static.sh @@ -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 . +