87 lines
2.1 KiB
Groovy
87 lines
2.1 KiB
Groovy
buildscript {
|
|
repositories {
|
|
jcenter()
|
|
}
|
|
|
|
dependencies {
|
|
classpath 'com.android.tools.build:gradle-experimental:0.6.0-alpha3'
|
|
}
|
|
}
|
|
|
|
apply plugin: 'com.android.model.application'
|
|
|
|
def demosDir = "../.."
|
|
def smokeDir = "${demosDir}/demos/Smoke"
|
|
def glmDir = "${demosDir}/../libs"
|
|
def vulkanDir = "${demosDir}/../Vulkan-Docs/src"
|
|
|
|
Properties properties = new Properties()
|
|
properties.load(project.rootProject.file('local.properties').newDataInputStream())
|
|
def ndkDir = properties.getProperty('ndk.dir')
|
|
|
|
model {
|
|
android {
|
|
compileSdkVersion = 23
|
|
buildToolsVersion = "23.0.2"
|
|
|
|
defaultConfig.with {
|
|
applicationId = "com.example.Smoke"
|
|
minSdkVersion.apiLevel = 22
|
|
targetSdkVersion.apiLevel = 22
|
|
versionCode = 1
|
|
versionName = "0.1"
|
|
}
|
|
}
|
|
|
|
android.ndk {
|
|
moduleName = "Smoke"
|
|
toolchain = "clang"
|
|
stl = "c++_static"
|
|
|
|
cppFlags.addAll(["-std=c++11", "-fexceptions"])
|
|
cppFlags.addAll(["-Wall", "-Wextra", "-Wno-unused-parameter"])
|
|
|
|
cppFlags.addAll([
|
|
"-DVK_NO_PROTOTYPES",
|
|
"-DVK_USE_PLATFORM_ANDROID_KHR",
|
|
"-DGLM_FORCE_RADIANS",
|
|
])
|
|
|
|
cppFlags.addAll([
|
|
"-I${file("${ndkDir}/sources/android/native_app_glue")}".toString(),
|
|
"-I${file("${vulkanDir}")}".toString(),
|
|
"-I${file("${glmDir}")}".toString(),
|
|
"-I${file("src/main/jni")}".toString(),
|
|
])
|
|
|
|
ldLibs.addAll(["android", "log", "dl"])
|
|
}
|
|
|
|
android.sources {
|
|
main {
|
|
jni {
|
|
source {
|
|
srcDir "${ndkDir}/sources/android/native_app_glue"
|
|
srcDir "${smokeDir}"
|
|
exclude 'ShellXcb.cpp'
|
|
exclude 'ShellWin32.cpp'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
android.buildTypes {
|
|
release {
|
|
ndk.with {
|
|
debuggable = true
|
|
}
|
|
}
|
|
}
|
|
|
|
android.productFlavors {
|
|
create ("fat") {
|
|
ndk.abiFilters.add("armeabi-v7a")
|
|
ndk.abiFilters.add("x86")
|
|
}
|
|
}
|
|
}
|