diff --git a/ndk-make.sh b/ndk-make.sh index 667c279f3..b3733d835 100755 --- a/ndk-make.sh +++ b/ndk-make.sh @@ -1,4 +1,3 @@ -echo -- cross compiling -- cd jni/deltachat-core-rust # to setup the toolchains (from https://medium.com/visly/rust-on-android-19f34a2fb43 ) @@ -15,21 +14,26 @@ cd jni/deltachat-core-rust # this installs toolchains in `~/.NDK` # then, the following should work: +echo "-- cross compiling to aarch64-linux-android (arm64) --" export RUSTFLAGS="-C linker=$HOME/.NDK/arm64/bin/clang"; export PATH=~/.NDK/arm64/bin:$PATH; cargo build --release --target aarch64-linux-android -p deltachat_ffi +echo "-- cross compiling to armv7-linux-androideabi (arm) --" export RUSTFLAGS="-C linker=$HOME/.NDK/arm/bin/clang"; export PATH=~/.NDK/arm/bin:$PATH; cargo build --release --target armv7-linux-androideabi -p deltachat_ffi +echo "-- cross compiling to x86_64-linux-android (x86_64) --" +export RUSTFLAGS="-C linker=$HOME/.NDK/x86_64/bin/clang"; +export PATH=~/.NDK/x86_64/bin:$PATH; +cargo build --release --target x86_64-linux-android -p deltachat_ffi + +echo "-- cross compiling to i686-linux-android (x86) --" export RUSTFLAGS="-C linker=$HOME/.NDK/x86/bin/clang"; export PATH=~/.NDK/x86/bin:$PATH; cargo build --release --target i686-linux-android -p deltachat_ffi -export RUSTFLAGS="-C linker=$HOME/.NDK/x86_64/bin/clang"; -export PATH=~/.NDK/x86_64/bin:$PATH; -cargo build --release --target x86_64-linux-android -p deltachat_ffi # an alternative might be: # $ cross build --release --target -p deltachat_ffi