Fix cargo-ndk build command (#15648)

# 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 ...
```
This commit is contained in:
Eero Lehtinen 2024-10-04 22:20:25 +03:00 committed by GitHub
parent e72b9625d7
commit d0edbdac78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -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`: To build an Android app, you first need to build shared object files for the target architecture with `cargo-ndk`:
```sh ```sh
cargo ndk -t <target_name> build -o <project_name>/app/src/main/jniLibs cargo ndk -t <target_name> -o <project_name>/app/src/main/jniLibs build
``` ```
For example, to compile to a 64-bit ARM platform: For example, to compile to a 64-bit ARM platform:
```sh ```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. Setting the output path ensures the shared object files can be found in target-specific directories under `jniLibs` where the JNI can find them.

View file

@ -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`: To build an Android app, you first need to build shared object files for the target architecture with `cargo-ndk`:
```sh ```sh
cargo ndk -t <target_name> build -o <project_name>/app/src/main/jniLibs cargo ndk -t <target_name> -o <project_name>/app/src/main/jniLibs build
``` ```
For example, to compile to a 64-bit ARM platform: For example, to compile to a 64-bit ARM platform:
```sh ```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. Setting the output path ensures the shared object files can be found in target-specific directories under `jniLibs` where the JNI can find them.