Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Android ndk-build usage #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions PluginSource/projects/Android/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

# Android Build Instructions

### Setup Environment Variables
```sh
# install so file to unity project
export NDK_LIBS_OUT="~/workspaecs/NativeRenderingPlugin/UnityProject/Assets/Plugins/Android/libs"
```


### Build
```sh
# windows
$NDK21/ndk-build.cmd


# linux/mac
$NDK21/ndk-build
```

`NDK21` is the path to your NDK installation. For example, `~/Library/Android/sdk/ndk/21.0.6113669` on macOS.


Finally output:
```sh
.
└── libs
├── arm64-v8a
│ ├── libc++_shared.so
│ └── libRenderingPlugin.so
├── armeabi-v7a
│ ├── libc++_shared.so
│ └── libRenderingPlugin.so
├── x86
│ ├── libc++_shared.so
│ └── libRenderingPlugin.so
└── x86_64
├── libc++_shared.so
└── libRenderingPlugin.so
```
4 changes: 2 additions & 2 deletions PluginSource/projects/Android/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
APP_PLATFORM := android-9
APP_STL := gnustl_static
APP_PLATFORM := android-16
APP_STL := c++_shared
APP_CPPFLAGS += -std=c++11
NDK_TOOLCHAIN_VERSION := clang