Skip to content

Commit 2fbca2d

Browse files
author
Mitchell Dowd
committed
Added the cmake build files.
1 parent 008c11e commit 2fbca2d

File tree

3 files changed

+35
-29
lines changed

3 files changed

+35
-29
lines changed

android/AndroidManifest.xml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- BEGIN_INCLUDE(manifest) -->
3+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
4+
package="jnipp"
5+
android:versionCode="1"
6+
android:versionName="1.0">
7+
</manifest>
8+
<!-- END_INCLUDE(manifest) -->

android/CMakeLists.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CMAKE_MINIMUM_REQUIRED(VERSION 3.4.1)
2+
3+
PROJECT(native_app)
4+
5+
FILE(GLOB sources ../*.cpp ../common/*.cpp ../android/*.cpp)
6+
7+
ADD_LIBRARY(native_app ${sources})

build.gradle

+20-29
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,30 @@
1-
apply plugin: 'com.android.model.native'
1+
apply plugin: 'com.android.library'
22

3-
model {
4-
android {
5-
compileSdkVersion = 24
6-
buildToolsVersion = '25.0.3'
3+
android {
4+
compileSdkVersion 26
5+
buildToolsVersion '28.0.3'
76

8-
defaultConfig {
9-
minSdkVersion.apiLevel = 15
10-
targetSdkVersion.apiLevel = 24
11-
}
7+
defaultConfig {
8+
minSdkVersion 15
9+
targetSdkVersion 26
10+
}
1211

13-
ndk {
14-
platformVersion = 15
15-
moduleName = 'jnipp'
16-
toolchain = 'clang'
17-
stl = 'c++_static'
18-
cppFlags.addAll(['-std=c++11', '-fexceptions', '-I' + file('.').absolutePath])
19-
ldLibs.addAll(['log', 'android', 'EGL', 'GLESv1_CM'])
12+
buildTypes {
13+
release {
14+
minifyEnabled = false
15+
proguardFiles getDefaultProguardFile('proguard-android.txt')
2016
}
17+
}
2118

22-
buildTypes {
23-
release {
24-
minifyEnabled = false
25-
proguardFiles.add(file('proguard-rules.txt'))
26-
}
19+
sourceSets {
20+
main {
21+
manifest.srcFile 'android/AndroidManifest.xml'
2722
}
23+
}
2824

29-
sources {
30-
main {
31-
jni {
32-
source {
33-
srcDir '.'
34-
}
35-
}
36-
}
25+
externalNativeBuild {
26+
cmake {
27+
path 'android/CMakeLists.txt'
3728
}
3829
}
3930
}

0 commit comments

Comments
 (0)