native bullet: allow cross compiling linux -> windows
This commit is contained in:
parent
9332a04b18
commit
6296819697
@ -34,7 +34,14 @@ 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) {
|
||||||
cppCompiler.args '-I', "${org.gradle.internal.jvm.Jvm.current().javaHome}/include/win32"
|
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 "-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…
x
Reference in New Issue
Block a user