File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -130,9 +130,9 @@ Prerequisites:
130130 ```
131131 cargo install cargo-ndk
132132 ```
133- * Install the Android Rust toolchain:
133+ * Install the Android Rust toolchain for your machine's hardware :
134134 ```
135- rustup target add aarch64-linux-android
135+ rustup target add aarch64-linux-android x86_64-linux-android
136136 ```
137137* Depending on the location of the Android SDK, you may need to set
138138 ` ANDROID_HOME ` :
Original file line number Diff line number Diff line change @@ -59,6 +59,13 @@ buildApp=${buildApp:-no}
5959
6060cd " ${elementPwd} "
6161
62+ default_arch=" $( uname -m) -linux-android"
63+ # On ARM MacOS, `uname -m` returns arm64, but the toolchain is called aarch64
64+ default_arch=" ${default_arch/ arm64/ aarch64} "
65+
66+ read -p " Enter the architecture you want to build for (default '$default_arch '): " target_arch
67+ target_arch=" ${target_arch:- ${default_arch} } "
68+
6269# If folder ../matrix-rust-components-kotlin does not exist, clone the repo
6370if [ ! -d " ../matrix-rust-components-kotlin" ]; then
6471 printf " \nFolder ../matrix-rust-components-kotlin does not exist. Cloning the repository into ../matrix-rust-components-kotlin.\n\n"
@@ -71,8 +78,8 @@ git reset --hard
7178git checkout main
7279git pull
7380
74- printf " \nBuilding the SDK for aarch64-linux-android ...\n\n"
75- ./scripts/build.sh -p " ${rustSdkPath} " -m sdk -t aarch64-linux-android -o " ${elementPwd} /libraries/rustsdk"
81+ printf " \nBuilding the SDK for ${target_arch} ...\n\n"
82+ ./scripts/build.sh -p " ${rustSdkPath} " -m sdk -t " ${target_arch} " -o " ${elementPwd} /libraries/rustsdk"
7683
7784cd " ${elementPwd} "
7885mv ./libraries/rustsdk/sdk-android-debug.aar ./libraries/rustsdk/matrix-rust-sdk.aar
You can’t perform that action at this time.
0 commit comments