From eaf462a1b2cb1d3888e200734a1017ce398b3def Mon Sep 17 00:00:00 2001 From: ardocrat Date: Sun, 7 Jul 2024 09:41:49 +0300 Subject: [PATCH] build: fix android --- scripts/android.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/scripts/android.sh b/scripts/android.sh index 297985b..6366791 100755 --- a/scripts/android.sh +++ b/scripts/android.sh @@ -40,25 +40,21 @@ type=$1 # Build native code cargo install cargo-ndk -mkdir -p android/app/src/main/jniLibs -sed -i -e 's/"rlib"/"rlib","cdylib"/g' Cargo.toml +sed -i -e 's/"rlib"/"cdylib","rlib"/g' Cargo.toml # temp fix for https://stackoverflow.com/questions/57193895/error-use-of-undeclared-identifier-pthread-mutex-robust-cargo-build-liblmdb-s success=0 export CPPFLAGS="-DMDB_USE_ROBUST=0" && export CFLAGS="-DMDB_USE_ROBUST=0" +cargo ndk -t ${arch} build ${release_param} +unset CPPFLAGS && unset CFLAGS cargo ndk -t ${arch} -o android/app/src/main/jniLibs build ${release_param} -if [ $? -eq 1 ] -then - unset CPPFLAGS && unset CFLAGS - cargo ndk -t ${arch} -o android/app/src/main/jniLibs build ${release_param} -fi if [ $? -eq 0 ] then success=1 fi -sed -i -e 's/"rlib","cdylib"/"rlib"/g' Cargo.toml +sed -i -e 's/"cdylib","rlib"/"rlib"/g' Cargo.toml # Build Android application and launch at all connected devices if [ $success -eq 1 ]