Skip to content

Commit

Permalink
Fix cargo-ndk build command (#15648)
Browse files Browse the repository at this point in the history
# 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 ...
```
  • Loading branch information
eero-lehtinen authored Oct 4, 2024
1 parent e72b962 commit d0edbda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs-template/EXAMPLE_README.md.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 <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:

```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.
Expand Down
4 changes: 2 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <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:

```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.
Expand Down

0 comments on commit d0edbda

Please sign in to comment.