tweak ndk-make

This commit is contained in:
B. Petersen
2019-10-05 18:35:00 +02:00
parent 523e056d51
commit 28d6d10c0b
+8 -4
View File
@@ -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 <target> -p deltachat_ffi