From d0edbdac78e28858b52f8d5d4691492e3f98bc9e Mon Sep 17 00:00:00 2001 From: Eero Lehtinen Date: Fri, 4 Oct 2024 22:20:25 +0300 Subject: [PATCH] Fix cargo-ndk build command (#15648) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Objective - Fix cargo-ndk build command documentation in readme. ```sh ❯ cargo ndk -t arm64-v8a build -o android_example/app/src/main/jniLibs Building arm64-v8a (aarch64-linux-android) error: unexpected argument '-o' found ``` ## Solution - Move "build" to the end of the command. ## Testing - With the new command order building works. ```sh ❯ cargo ndk -t arm64-v8a -o android_example/app/src/main/jniLibs build Building arm64-v8a (aarch64-linux-android) Compiling bevy_ptr v0.15.0-dev (/home/eero/repos/bevy/crates/bevy_ptr) Compiling bevy_macro_utils v0.15.0-dev (/home/eero/repos/bevy/crates/bevy_macro_utils) Compiling event-listener v5.3.1 ... rest of compilation ... ``` --- docs-template/EXAMPLE_README.md.tpl | 4 ++-- examples/README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs-template/EXAMPLE_README.md.tpl b/docs-template/EXAMPLE_README.md.tpl index 7d8fa20f39..c1fbfc08eb 100644 --- a/docs-template/EXAMPLE_README.md.tpl +++ b/docs-template/EXAMPLE_README.md.tpl @@ -106,13 +106,13 @@ Alternatively, you can install Android Studio. To build an Android app, you first need to build shared object files for the target architecture with `cargo-ndk`: ```sh -cargo ndk -t build -o /app/src/main/jniLibs +cargo ndk -t -o /app/src/main/jniLibs build ``` For example, to compile to a 64-bit ARM platform: ```sh -cargo ndk -t arm64-v8a build -o android_example/app/src/main/jniLibs +cargo ndk -t arm64-v8a -o android_example/app/src/main/jniLibs build ``` Setting the output path ensures the shared object files can be found in target-specific directories under `jniLibs` where the JNI can find them. diff --git a/examples/README.md b/examples/README.md index e8bbb36e45..9847a69508 100644 --- a/examples/README.md +++ b/examples/README.md @@ -561,13 +561,13 @@ Alternatively, you can install Android Studio. To build an Android app, you first need to build shared object files for the target architecture with `cargo-ndk`: ```sh -cargo ndk -t build -o /app/src/main/jniLibs +cargo ndk -t -o /app/src/main/jniLibs build ``` For example, to compile to a 64-bit ARM platform: ```sh -cargo ndk -t arm64-v8a build -o android_example/app/src/main/jniLibs +cargo ndk -t arm64-v8a -o android_example/app/src/main/jniLibs build ``` Setting the output path ensures the shared object files can be found in target-specific directories under `jniLibs` where the JNI can find them.