Skip to content

Commit

Permalink
apply requested fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
maelchiotti committed Jan 3, 2025
1 parent 668bbde commit e93e743
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions scripts/build-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ mkdir -p $JNI_DIR
# Set up cargo-ndk
cargo install cargo-ndk --locked

# Add targets
rustup target add \
aarch64-linux-android \
armv7-linux-androideabi \
x86_64-linux-android \
i686-linux-android

# Build the android libraries in the jniLibs directory
if [ "$#" -eq 0 ]; then
cargo ndk -o $JNI_DIR \
Expand All @@ -21,20 +28,19 @@ if [ "$#" -eq 0 ]; then
-t x86 \
-t x86_64 \
build --release
# Archive the dynamic libs
cd $JNI_DIR || exit
tar -czvf ../EmbeddedMilliAndroid.tar.gz ./*
cd - || exit
# Cleanup
rm -rf $JNI_DIR
elif [ "$1" = "x86" ]; then
rustup target add i686-linux-android
cargo ndk -o $JNI_DIR --manifest-path ../Cargo.toml -t x86 build --release
elif [ "$1" = "x64" ]; then
rustup target add x86_64-linux-android
cargo ndk -o $JNI_DIR --manifest-path ../Cargo.toml -t x86_64 build --release
elif [ "$1" = "armv7" ]; then
rustup target add armv7-linux-androideabi
cargo ndk -o $JNI_DIR --manifest-path ../Cargo.toml -t armeabi-v7a build --release
elif [ "$1" = "arm64" ]; then
rustup target add aarch64-linux-android
cargo ndk -o $JNI_DIR --manifest-path ../Cargo.toml -t arm64-v8a build --release
else
echo "Invalid architecture: '$1'"
Expand Down

0 comments on commit e93e743

Please sign in to comment.