native bullet: allow cross compiling linux -> windows

cleanup_build_scripts
Kirill Vainer 9 years ago
parent 9332a04b18
commit 6296819697
  1. 32
      jme3-bullet-native/build.gradle

@ -34,8 +34,15 @@ libraries {
// linker.args "-static-libstdc++" // linker.args "-static-libstdc++"
} else if (targetPlatform.operatingSystem.name == "windows") { } else if (targetPlatform.operatingSystem.name == "windows") {
if (toolChain in Gcc) { if (toolChain in Gcc) {
if (toolChain.name.startsWith('mingw')) {
cppCompiler.args '-I', "${org.gradle.internal.jvm.Jvm.current().javaHome}/include/linux"
} else {
cppCompiler.args '-I', "${org.gradle.internal.jvm.Jvm.current().javaHome}/include/win32" cppCompiler.args '-I', "${org.gradle.internal.jvm.Jvm.current().javaHome}/include/win32"
} }
cppCompiler.args "-fpermissive"
cppCompiler.args "-static"
linker.args "-static"
}
else if (toolChain in VisualCpp) { else if (toolChain in VisualCpp) {
cppCompiler.args "/I${org.gradle.internal.jvm.Jvm.current().javaHome}\\include\\win32" cppCompiler.args "/I${org.gradle.internal.jvm.Jvm.current().javaHome}\\include\\win32"
} }
@ -76,6 +83,31 @@ sourceSets {
// Set of target platforms, will be available based on build system // Set of target platforms, will be available based on build system
model { model {
toolChains {
gcc(Gcc)
mingw_x86(Gcc) {
eachPlatform() {
cCompiler.executable "i686-w64-mingw32-gcc"
cppCompiler.executable "i686-w64-mingw32-g++"
linker.executable "i686-w64-mingw32-g++"
assembler.executable "i686-w64-mingw32-g++"
staticLibArchiver.executable "i686-w64-mingw32-gcc-ar"
}
target("windows_x86")
}
mingw_x86_64(Gcc) {
eachPlatform() {
cCompiler.executable "x86_64-w64-mingw32-gcc"
cppCompiler.executable "x86_64-w64-mingw32-g++"
linker.executable "x86_64-w64-mingw32-g++"
assembler.executable "x86_64-w64-mingw32-g++"
staticLibArchiver.executable "x86_64-w64-mingw32-gcc-ar"
}
target("windows_x86_64")
}
}
platforms{ platforms{
// osx_universal { // TODO: universal binary doesn't work? // osx_universal { // TODO: universal binary doesn't work?
// architecture 'x86_64' // architecture 'x86_64'

Loading…
Cancel
Save