Bug 1823842 - Explicitly only build the wrench library on android. r=gfx-reviewers,jnicol

When upgrading the NDK to r23, the wrench builds for android fail
because cargo apk starts adding flags to the cargo rustc call it does,
and that's not compatible with the wrench crate having both a lib and a
bin target.

As cargo apk only packages the lib in the apk, we can just be explicit
and build the library only.

Differential Revision: https://phabricator.services.mozilla.com/D173244
This commit is contained in:
Mike Hommey 2023-03-22 09:02:37 +00:00
Родитель f8d51bf5b5
Коммит ba20433bd5
2 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -25,7 +25,7 @@ Compiling and running:
cd wrench
export ANDROID_SDK_ROOT=$HOME/.mozbuild/android-sdk-linux # exact path may vary
export ANDROID_NDK_ROOT=$HOME/.mozbuild/android-ndk-r21d # exact path may vary
cargo apk build
cargo apk build --lib
Install the APK:
adb install -r ../target/debug/apk/wrench.apk
@ -57,7 +57,7 @@ Release mode:
cd wrench
export ANDROID_SDK_ROOT=$HOME/.mozbuild/android-sdk-linux # exact path may vary
export ANDROID_NDK_ROOT=$HOME/.mozbuild/android-ndk-r21d # exact path may vary
cargo apk build --release
cargo apk build --lib --release
Now the APK at ../target/release/apk/wrench.apk
should be signed and installable (you may need to uninstall the debug APK first if you

Просмотреть файл

@ -16,9 +16,9 @@ export ANDROID_SDK_ROOT="${MOZ_FETCHES_DIR}/android-sdk-linux"
export ANDROID_NDK_ROOT="${MOZ_FETCHES_DIR}/android-ndk"
if [ "$MODE" == "debug" ]; then
../cargo-apk/bin/cargo-apk apk build --frozen --verbose
../cargo-apk/bin/cargo-apk apk build --frozen --verbose --lib
elif [ "$MODE" == "release" ]; then
../cargo-apk/bin/cargo-apk apk build --frozen --verbose --release
../cargo-apk/bin/cargo-apk apk build --frozen --verbose --lib --release
else
echo "Unknown mode '${MODE}'; must be 'debug' or 'release'"
exit 1