-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
55 lines (47 loc) · 1.71 KB
/
build.gradle
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
apply plugin: 'com.android.application'
// 本地配置文件的使用
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
def superpowered_sdk_path = properties.getProperty('superpowered.dir')
android { // main settings for your application
compileSdkVersion = 23
buildToolsVersion = "23.0.2"
defaultConfig {
applicationId "com.superpowered.crossexample"
minSdkVersion 16 // more than 95% of all active Android devices
targetSdkVersion 23
versionCode 1
versionName "1.0"
// ndk如何和android studio集成呢?
ndk {
// these platforms cover 99% percent of all Android devices
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
// 如何编译Native的代码呢?
externalNativeBuild {
cmake {
arguments '-DANDROID_PLATFORM=android-16', '-DANDROID_TOOLCHAIN=clang',
'-DANDROID_ARM_NEON=TRUE', '-DANDROID_STL=gnustl_static',
"-DPATH_TO_SUPERPOWERED:STRING=${superpowered_sdk_path}"
cFlags '-O3', '-fsigned-char' // full optimization, char data type is signed
cppFlags '-fsigned-char', "-I${superpowered_sdk_path}"
}
}
}
sourceSets {
// 指定Native的代码
main {
jniLibs.srcDirs = ['src/main/jni']
}
}
// 指定代码的编译方式
externalNativeBuild {
cmake {
path 'src/main/jni/CMakeLists.txt'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
}