blob: 70f68cd7b7b837392cef319a6976a0fb3b191b7b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
Build Validation Layers with Android CMake
=========================================
Gradle's CMake library project in this directory builds layers into AAR;
the project could be directly added into application's gradle projects
Pre-requirements
----------------
Build ShaderC binary
- Building from Github Repo source
1. cd android-build
2. ./update_external_sources_android.sh
3. ./android-generate.sh
Extra Steps if building from NDK's source tree
```
cd ${your ANDROID_NDK_ROOT}/sources/third_party/shaderc
ndk-build APP_ABI=armeabi-v7a APP_STL=gnustl_static NDK_TOOLCHAIN_VERSION=clang NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=Android.mk libshaderc_combined
```
Adding layer module into Android Studio application project
--------------------------------------------------------
1. app's settings.gradle, add
```java
include ':layerLib'
project(':layerLib').projectDir = new File('/path/to/cmake/layerlib')
```
2. app's build.gradle:
```java
dependencies {
// force debug layer lib for packing
compile project(path: ':layerlib', configuration: 'debug')
}
```
BUILD_IN_NDK variable in layerlib/CMakeLists.txt could detect whether the source is
from NDK or github repo clone, and would configure the file paths accordingly
Tested
-----
Build on Mac OS, Nexus 5X test phone. Equvilaent build scripts for Windows OS are at the same directory.
|