# HG changeset patch # Parent 95dfd1a03955fd790fe7e11097ec9a19c9dc258b Fix RT-31510 How to use addNative for specific compile target. Allow specifu includeTargets into addNative. diff -r 95dfd1a03955 -r 9b57f37d29c6 build.gradle --- a/build.gradle Tue Jul 09 16:40:18 2013 +0200 +++ b/build.gradle Tue Jul 09 17:23:08 2013 +0200 @@ -622,6 +622,9 @@ * or whatnot depending on the platform. */ void addNative(Project project, String name) { + addNative(project, name, null) +} +void addNative(Project project, String name, String... includeTargets) { // TODO if we want to handle 32/64 bit windows in the same build, // Then we will need to modify the win compile target to be win32 or win64 def capitalName = name.split("-").collect{it.capitalize()}.join() @@ -636,6 +639,9 @@ def libRootDir = project.file("$project.buildDir/libs/$name") // For each compile target, create a javah / cc / link triplet compileTargets { t -> + if (includeTargets != null && !includeTargets.contains(t.name)) { + return + } def targetProperties = project.rootProject.ext[t.upper] def library = targetProperties.library def properties = targetProperties.get(name) diff -r 95dfd1a03955 -r 9b57f37d29c6 buildSrc/android.gradle --- a/buildSrc/android.gradle Tue Jul 09 16:40:18 2013 +0200 +++ b/buildSrc/android.gradle Tue Jul 09 17:23:08 2013 +0200 @@ -112,8 +112,8 @@ } afterEvaluate { - addNative(project, "surface") - addNative(project, "vmlauncher") + addNative(project, "surface", "android") + addNative(project, "vmlauncher", "android") tasks["javahAndroidVmlauncher"].dependsOn(compileDalvikLibs) tasks["native"].dependsOn("nativeSurface", "nativeVmlauncher")