Add support for Linux 32/64 as host OS for cross compiling to Windows x86

This commit is contained in:
Ivan Kravets
2015-08-10 16:16:16 +03:00
parent 5679271913
commit 2b8f7824c2
2 changed files with 13 additions and 12 deletions

View File

@ -2,7 +2,7 @@
# See LICENSE for details.
"""
Builder for Windows x86
Builder for Windows x86 / 32bit
"""
from SCons.Script import AlwaysBuild, Default, DefaultEnvironment
@ -13,13 +13,14 @@ from platformio.util import get_systype
env = DefaultEnvironment()
env.Replace(
AR="$_MINGWPREFIX-ar",
AS="$_MINGWPREFIX-as",
CC="$_MINGWPREFIX-gcc",
CXX="$_MINGWPREFIX-g++",
OBJCOPY="$_MINGWPREFIX-objcopy",
RANLIB="$_MINGWPREFIX-ranlib",
SIZETOOL="$_MINGWPREFIX-size",
_BINPREFIX="",
AR="${_BINPREFIX}ar",
AS="${_BINPREFIX}as",
CC="${_BINPREFIX}gcc",
CXX="${_BINPREFIX}g++",
OBJCOPY="${_BINPREFIX}objcopy",
RANLIB="${_BINPREFIX}ranlib",
SIZETOOL="${_BINPREFIX}size",
SIZEPRINTCMD='"$SIZETOOL" $SOURCES',
PROGSUFFIX=".exe"
@ -27,11 +28,11 @@ env.Replace(
if get_systype() == "darwin_x86_64":
env.Replace(
_MINGWPREFIX="i586-mingw32"
_BINPREFIX="i586-mingw32-"
)
elif get_systype() in ("linux_x86_64", "linux_i686"):
env.Replace(
_MINGWPREFIX="i686-w64-mingw32"
_BINPREFIX="i686-w64-mingw32-"
)
#

View File

@ -9,8 +9,8 @@ class Windows_x86Platform(BasePlatform):
"""
Windows x86 (32-bit) is a metafamily of graphical operating systems
developed and marketed by Microsoft.
Using host OS (Windows or Mac OS X) you can build native application
for Windows x86 platform.
Using host OS (Windows, Linux 32/64 or Mac OS X) you can build native
application for Windows x86 platform.
http://platformio.org/#!/platforms/windows_x86
"""