add script to select rust flags per target

This commit is contained in:
finn 2022-07-31 12:40:22 -07:00
parent ebbdb88922
commit 4493010e5e
2 changed files with 9 additions and 1 deletions

View file

@ -32,7 +32,7 @@ compile:
- git clone https://github.com/signalapp/libsignal-client
- cd libsignal-client && git checkout "$libsignal_version"
- rustup target add "${TARGET}"
- RUSTFLAGS='-C link-arg=-s' cargo build -p libsignal-jni --target "${TARGET}" --release --verbose
- RUSTFLAGS="$(./rustflags.sh)" cargo build -p libsignal-jni --target "${TARGET}" --release --verbose
- cp -v target/${TARGET}/release/libsignal_jni.so ../libsignal_jni-${TARGET}.so
artifacts:
paths:

8
rustflags.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
flags="-C link-arg=-s"
if [[ "${TARGET}" == *musl ]]; then
flags="${flags} -C target-feature=-crt-static"
fi
echo "${flags}"