Skip to content

Commit

Permalink
Fix android build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ianrumac committed Nov 12, 2024
1 parent ae8666a commit a4400f5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions build_android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ export ANDROID_NDK=r25b ANDROID_SDK=26 ANDROID_VERSION=11.0.0_r48
build_targets=(
"x86_64-linux-android"
"armv7-linux-androideabi"
"aarch64-linux-android",
"aarch64-linux-android"
"i686-linux-android"
)

export CROSS_NO_WARNINGS=0
for target in "${build_targets[@]}"; do
rustup target add "$target"
echo "Building for $target"
cross build --target "$target" --release --lib
done
Expand All @@ -23,12 +25,12 @@ echo "Copying results to target/android/jniLibs"
target_dir="target/android"
jniLibs_dir="${target_dir}/jniLibs"

mkdir -p "${jniLibs_dir}"/{arm64-v8a,armeabi-v7a,x86_64}
mkdir -p "${jniLibs_dir}"/{arm64-v8a,armeabi-v7a,x86_64,x86}

cp target/aarch64-linux-android/release/libcel_eval.so "${jniLibs_dir}/arm64-v8a/libuniffi_cel.so"
cp target/armv7-linux-androideabi/release/libcel_eval.so "${jniLibs_dir}/armeabi-v7a/libuniffi_cel.so"
cp target/x86_64-linux-android/release/libcel_eval.so "${jniLibs_dir}/x86_64/libuniffi_cel.so"
cp target/i686-linux-android/release/libcel_eval.so "${jniLibs_dir}/i686/libuniffi_cel.so"
cp target/i686-linux-android/release/libcel_eval.so "${jniLibs_dir}/x86/libuniffi_cel.so"

echo "Running UniFFI to generate Kotlin bindings"
mkdir -p "${target_dir}/java/uniffi/cel"
Expand Down

0 comments on commit a4400f5

Please sign in to comment.