|
@@ -43,12 +43,17 @@ model {
|
|
"LinuxArm64"
|
|
"LinuxArm64"
|
|
];
|
|
];
|
|
|
|
|
|
- String[] filter=buildForPlatforms.split(",");
|
|
|
|
|
|
+ String[] filter=gradle.rootProject.ext.usePrebuildNatives==true?null:buildForPlatforms.split(",");
|
|
|
|
+ if(filter==null)println("No filter set. build for all");
|
|
for(String target:targets){
|
|
for(String target:targets){
|
|
- for(String f:filter){
|
|
|
|
- if(f.equals(target)){
|
|
|
|
- targetPlatform(target);
|
|
|
|
- break;
|
|
|
|
|
|
+ if(filter==null){
|
|
|
|
+ targetPlatform(target);
|
|
|
|
+ }else{
|
|
|
|
+ for(String f:filter){
|
|
|
|
+ if(f.equals(target)){
|
|
|
|
+ targetPlatform(target);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -79,8 +84,8 @@ model {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
toolChains {
|
|
toolChains {
|
|
visualCpp(VisualCpp)
|
|
visualCpp(VisualCpp)
|
|
gcc(Gcc)
|
|
gcc(Gcc)
|
|
@@ -110,12 +115,12 @@ model {
|
|
linker.executable = "aarch64-linux-gnu-gcc-8"
|
|
linker.executable = "aarch64-linux-gnu-gcc-8"
|
|
assembler.executable = "aarch64-linux-gnu-as"
|
|
assembler.executable = "aarch64-linux-gnu-as"
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
binaries {
|
|
binaries {
|
|
withType(SharedLibraryBinarySpec) {
|
|
withType(SharedLibraryBinarySpec) {
|
|
- def projectPath = project.projectDir.absolutePath
|
|
|
|
|
|
+ def rootPath = rootProject.projectDir.absolutePath
|
|
def javaHome = org.gradle.internal.jvm.Jvm.current().javaHome
|
|
def javaHome = org.gradle.internal.jvm.Jvm.current().javaHome
|
|
def os = targetPlatform.operatingSystem.name
|
|
def os = targetPlatform.operatingSystem.name
|
|
def arch = targetPlatform.architecture.name
|
|
def arch = targetPlatform.architecture.name
|
|
@@ -139,7 +144,7 @@ model {
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
// Get from libs folder if no fresh build is available in the build folder and add to jar file
|
|
// Get from libs folder if no fresh build is available in the build folder and add to jar file
|
|
- def precompiledFile = Paths.get(projectPath, 'libs', 'native', os, arch, fileName).toFile()
|
|
|
|
|
|
+ def precompiledFile = Paths.get(rootPath, 'build', 'native', 'bullet', os, arch, fileName).toFile()
|
|
if (precompiledFile.exists()) {
|
|
if (precompiledFile.exists()) {
|
|
jar.into("native/${os}/${arch}") {
|
|
jar.into("native/${os}/${arch}") {
|
|
from precompiledFile
|
|
from precompiledFile
|
|
@@ -203,8 +208,8 @@ model {
|
|
// Add output to libs folder
|
|
// Add output to libs folder
|
|
task "copyBinaryToLibs${targetPlatform.name}"(type: Copy, dependsOn: tasks) {
|
|
task "copyBinaryToLibs${targetPlatform.name}"(type: Copy, dependsOn: tasks) {
|
|
from sharedLibraryFile
|
|
from sharedLibraryFile
|
|
- into "libs/native/${os}/${arch}"
|
|
|
|
- }
|
|
|
|
|
|
+ into "${rootPath}/build/native/bullet/${os}/${arch}"
|
|
|
|
+ }
|
|
// Add depend on copy
|
|
// Add depend on copy
|
|
jar.dependsOn("copyBinaryToLibs${targetPlatform.name}")
|
|
jar.dependsOn("copyBinaryToLibs${targetPlatform.name}")
|
|
}
|
|
}
|