Skip to content

Commit 273f65b

Browse files
committed
Fix toolchain. Add way to select wich platform you want to build.
1 parent 88385ba commit 273f65b

2 files changed

Lines changed: 39 additions & 18 deletions

File tree

gradle.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ buildJavaDoc = true
1414
buildNativeProjects = false
1515
buildAndroidExamples = false
1616

17-
# Path to Android NDK for building native libraries
17+
buildForPlatforms = Linux64,Linux32,Windows64,Windows32,Mac64,Mac32
18+
19+
# Path to android NDK for building native libraries
20+
#ndkPath=/Users/normenhansen/Documents/Code-Import/android-ndk-r7
1821
ndkPath = /opt/android-ndk-r16b
1922

2023
# Path for downloading native Bullet

jme3-bullet-native/build.gradle

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,29 @@ task cleanZipFile(type: Delete) {
2929
model {
3030
components {
3131
bulletjme(NativeLibrarySpec) {
32-
targetPlatform 'Windows64'
33-
targetPlatform 'Windows32'
34-
targetPlatform 'Mac64'
35-
targetPlatform 'Mac32'
36-
targetPlatform 'Linux64'
37-
targetPlatform 'Linux32'
38-
targetPlatform 'LinuxArm'
39-
targetPlatform 'LinuxArmHF'
40-
targetPlatform 'LinuxArm64'
32+
33+
34+
String[] targets=[
35+
"Windows64",
36+
"Windows32",
37+
"Mac64",
38+
"Mac32",
39+
"Linux64",
40+
"Linux32",
41+
"LinuxArm",
42+
"LinuxArmHF",
43+
"LinuxArm64"
44+
];
45+
46+
String[] filter=buildForPlatforms.split(",");
47+
for(String target:targets){
48+
for(String f:filter){
49+
if(f.equals(target)){
50+
targetPlatform(target);
51+
break;
52+
}
53+
}
54+
}
4155

4256
sources {
4357
cpp {
@@ -66,25 +80,29 @@ model {
6680
}
6781
}
6882

83+
6984
toolChains {
85+
visualCpp(VisualCpp)
86+
gcc(Gcc)
87+
clang(Clang)
7088
gccArm(Gcc) {
7189
// Fun Fact: Gradle uses gcc as linker frontend, so we don't specify ld directly here
7290
target("LinuxArm"){
7391
path "/usr/bin"
74-
cCompiler.executable = "arm-linux-gnueabi-gcc-7"
75-
cppCompiler.executable = "arm-linux-gnueabi-g++-7"
76-
linker.executable = "arm-linux-gnueabi-gcc-7"
92+
cCompiler.executable = "arm-linux-gnueabi-gcc-8"
93+
cppCompiler.executable = "arm-linux-gnueabi-g++-8"
94+
linker.executable = "arm-linux-gnueabi-gcc-8"
7795
assembler.executable = "arm-linux-gnueabi-as"
7896
}
79-
97+
8098
target("LinuxArmHF"){
8199
path "/usr/bin"
82-
cCompiler.executable = "arm-linux-gnueabihf-gcc-7"
83-
cppCompiler.executable = "arm-linux-gnueabihf-g++-7"
84-
linker.executable = "arm-linux-gnueabihf-gcc-7"
100+
cCompiler.executable = "arm-linux-gnueabihf-gcc-8"
101+
cppCompiler.executable = "arm-linux-gnueabihf-g++-8"
102+
linker.executable = "arm-linux-gnueabihf-gcc-8"
85103
assembler.executable = "arm-linux-gnueabihf-as"
86104
}
87-
105+
88106
target("LinuxArm64"){
89107
path "/usr/bin"
90108
cCompiler.executable = "aarch64-linux-gnu-gcc-8"

0 commit comments

Comments
 (0)