Add MSVC amd64_x86 toolchain detection

Add MSVC amd64_x86 toolchain detection for cross compiling from amd64
compiler to x86 target. Enables processing of larger compilation units
especially useful for larger resource file inclusion (e.g: qgltf).

Change-Id: I1a73dd6be7eaf1ec1ce2155cbf8c06674bff192a
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
Unai IRIGOYEN
2016-03-14 22:05:02 +01:00
committed by Tobias Hunger
parent 450d4c4c84
commit 2ffd95f66a
2 changed files with 10 additions and 3 deletions

View File

@@ -61,6 +61,8 @@ static QString platformName(MsvcToolChain::Platform t)
switch (t) { switch (t) {
case MsvcToolChain::x86: case MsvcToolChain::x86:
return QLatin1String("x86"); return QLatin1String("x86");
case MsvcToolChain::amd64_x86:
return QLatin1String("amd64_x86");
case MsvcToolChain::amd64: case MsvcToolChain::amd64:
return QLatin1String("amd64"); return QLatin1String("amd64");
case MsvcToolChain::x86_amd64: case MsvcToolChain::x86_amd64:
@@ -83,7 +85,8 @@ static bool hostSupportsPlatform(MsvcToolChain::Platform platform)
{ {
switch (Utils::HostOsInfo::hostArchitecture()) { switch (Utils::HostOsInfo::hostArchitecture()) {
case Utils::HostOsInfo::HostArchitectureAMD64: case Utils::HostOsInfo::HostArchitectureAMD64:
if (platform == MsvcToolChain::amd64 || platform == MsvcToolChain::amd64_arm) if (platform == MsvcToolChain::amd64 || platform == MsvcToolChain::amd64_arm
|| platform == MsvcToolChain::amd64_x86)
return true; return true;
// fall through (all x86 toolchains are also working on an amd64 host) // fall through (all x86 toolchains are also working on an amd64 host)
case Utils::HostOsInfo::HostArchitectureX86: case Utils::HostOsInfo::HostArchitectureX86:
@@ -107,6 +110,7 @@ static Abi findAbiOfMsvc(MsvcToolChain::Type type, MsvcToolChain::Platform platf
switch (platform) switch (platform)
{ {
case MsvcToolChain::x86: case MsvcToolChain::x86:
case MsvcToolChain::amd64_x86:
wordWidth = 32; wordWidth = 32;
break; break;
case MsvcToolChain::ia64: case MsvcToolChain::ia64:
@@ -630,6 +634,8 @@ QString MsvcToolChainFactory::vcVarsBatFor(const QString &basePath, const QStrin
return basePath + QLatin1String("/bin/ia64/vcvars64.bat"); return basePath + QLatin1String("/bin/ia64/vcvars64.bat");
if (toolchainName == QLatin1String("x86_ia64")) if (toolchainName == QLatin1String("x86_ia64"))
return basePath + QLatin1String("/bin/x86_ia64/vcvarsx86_ia64.bat"); return basePath + QLatin1String("/bin/x86_ia64/vcvarsx86_ia64.bat");
if (toolchainName == QLatin1String("amd64_x86"))
return basePath + QLatin1String("/bin/amd64_x86/vcvarsamd64_x86.bat");
return QString(); return QString();
} }
@@ -809,7 +815,7 @@ QList<ToolChain *> MsvcToolChainFactory::autoDetect(const QList<ToolChain *> &al
// x86_arm was put before amd64_arm as a workaround for auto detected windows phone // x86_arm was put before amd64_arm as a workaround for auto detected windows phone
// toolchains. As soon as windows phone builds support x64 cross builds, this change // toolchains. As soon as windows phone builds support x64 cross builds, this change
// can be reverted. // can be reverted.
platforms << MsvcToolChain::x86 platforms << MsvcToolChain::x86 << MsvcToolChain::amd64_x86
<< MsvcToolChain::amd64 << MsvcToolChain::x86_amd64 << MsvcToolChain::amd64 << MsvcToolChain::x86_amd64
<< MsvcToolChain::arm << MsvcToolChain::x86_arm << MsvcToolChain::amd64_arm << MsvcToolChain::arm << MsvcToolChain::x86_arm << MsvcToolChain::amd64_arm
<< MsvcToolChain::ia64 << MsvcToolChain::x86_ia64; << MsvcToolChain::ia64 << MsvcToolChain::x86_ia64;

View File

@@ -49,7 +49,8 @@ public:
x86_ia64, x86_ia64,
arm, arm,
x86_arm, x86_arm,
amd64_arm amd64_arm,
amd64_x86
}; };
explicit MsvcToolChain(const QString &name, const Abi &abi, explicit MsvcToolChain(const QString &name, const Abi &abi,