build: fix android
This commit is contained in:
parent
01de9c997e
commit
eaf462a1b2
1 changed files with 4 additions and 8 deletions
|
@ -40,25 +40,21 @@ type=$1
|
||||||
|
|
||||||
# Build native code
|
# Build native code
|
||||||
cargo install cargo-ndk
|
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
|
# temp fix for https://stackoverflow.com/questions/57193895/error-use-of-undeclared-identifier-pthread-mutex-robust-cargo-build-liblmdb-s
|
||||||
success=0
|
success=0
|
||||||
export CPPFLAGS="-DMDB_USE_ROBUST=0" && export CFLAGS="-DMDB_USE_ROBUST=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}
|
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 ]
|
if [ $? -eq 0 ]
|
||||||
then
|
then
|
||||||
success=1
|
success=1
|
||||||
fi
|
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
|
# Build Android application and launch at all connected devices
|
||||||
if [ $success -eq 1 ]
|
if [ $success -eq 1 ]
|
||||||
|
|
Loading…
Reference in a new issue