forked from qt-creator/qt-creator
QbsProjectManager: Set qbs.targetPlatform rather than qbs.targetOS
This is the recommended way in qbs 1.11. Change-Id: Id20ecdc2b8332336c92c47cf05077dbe4e54cff2 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This commit is contained in:
@@ -74,63 +74,49 @@ static QString extractToolchainPrefix(QString *compilerName)
|
||||
return prefix;
|
||||
}
|
||||
|
||||
static QStringList targetOSList(const ProjectExplorer::Abi &abi, const ProjectExplorer::Kit *k)
|
||||
static QString targetPlatform(const ProjectExplorer::Abi &abi, const ProjectExplorer::Kit *k)
|
||||
{
|
||||
const Core::Id device = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(k);
|
||||
QStringList os;
|
||||
switch (abi.os()) {
|
||||
case ProjectExplorer::Abi::WindowsOS:
|
||||
if (device == WINRT_DEVICE_TYPE_LOCAL ||
|
||||
device == WINRT_DEVICE_TYPE_PHONE ||
|
||||
device == WINRT_DEVICE_TYPE_EMULATOR) {
|
||||
os << QLatin1String("winrt");
|
||||
} else if (abi.osFlavor() == ProjectExplorer::Abi::WindowsCEFlavor) {
|
||||
os << QLatin1String("windowsce");
|
||||
}
|
||||
os << QLatin1String("windows");
|
||||
break;
|
||||
case ProjectExplorer::Abi::DarwinOS:
|
||||
return QLatin1String("windows");
|
||||
case ProjectExplorer::Abi::DarwinOS:
|
||||
if (device == DESKTOP_DEVICE_TYPE)
|
||||
os << QLatin1String("macos") << QLatin1String("osx");
|
||||
else if (device == IOS_DEVICE_TYPE)
|
||||
os << QLatin1String("ios");
|
||||
else if (device == IOS_SIMULATOR_TYPE)
|
||||
os << QLatin1String("ios-simulator") << QLatin1String("ios");
|
||||
os << QLatin1String("darwin") << QLatin1String("bsd") << QLatin1String("unix");
|
||||
break;
|
||||
return QLatin1String("macos");
|
||||
if (device == IOS_DEVICE_TYPE)
|
||||
return QLatin1String("ios");
|
||||
if (device == IOS_SIMULATOR_TYPE)
|
||||
return QLatin1String("ios-simulator");
|
||||
return QLatin1String("darwin");
|
||||
case ProjectExplorer::Abi::LinuxOS:
|
||||
if (abi.osFlavor() == ProjectExplorer::Abi::AndroidLinuxFlavor)
|
||||
os << QLatin1String("android");
|
||||
os << QLatin1String("linux") << QLatin1String("unix");
|
||||
break;
|
||||
return QLatin1String("android");
|
||||
return QLatin1String("linux");
|
||||
case ProjectExplorer::Abi::BsdOS:
|
||||
switch (abi.osFlavor()) {
|
||||
case ProjectExplorer::Abi::FreeBsdFlavor:
|
||||
os << QLatin1String("freebsd");
|
||||
break;
|
||||
return QLatin1String("freebsd");
|
||||
case ProjectExplorer::Abi::NetBsdFlavor:
|
||||
os << QLatin1String("netbsd");
|
||||
break;
|
||||
return QLatin1String("netbsd");
|
||||
case ProjectExplorer::Abi::OpenBsdFlavor:
|
||||
os << QLatin1String("openbsd");
|
||||
break;
|
||||
return QLatin1String("openbsd");
|
||||
default:
|
||||
break;
|
||||
}
|
||||
os << QLatin1String("bsd") << QLatin1String("unix");
|
||||
break;
|
||||
return QLatin1String("bsd");
|
||||
case ProjectExplorer::Abi::QnxOS:
|
||||
os << QLatin1String("qnx") << QLatin1String("unix");
|
||||
break;
|
||||
return QLatin1String("qnx");
|
||||
case ProjectExplorer::Abi::UnixOS:
|
||||
if (abi.osFlavor() == ProjectExplorer::Abi::SolarisUnixFlavor)
|
||||
os << QLatin1String("solaris");
|
||||
os << QLatin1String("unix");
|
||||
break;
|
||||
default:
|
||||
return QLatin1String("solaris");
|
||||
return QLatin1String("unix");
|
||||
case ProjectExplorer::Abi::VxWorks:
|
||||
return QLatin1String("vxworks");
|
||||
case ProjectExplorer::Abi::BareMetalOS:
|
||||
case ProjectExplorer::Abi::UnknownOS:
|
||||
break;
|
||||
}
|
||||
return os;
|
||||
return QString();
|
||||
}
|
||||
|
||||
static QStringList toolchainList(const ProjectExplorer::ToolChain *tc)
|
||||
@@ -258,7 +244,7 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor
|
||||
ProjectExplorer::Abi::abiFromTargetTriplet(mainTc->originalTargetTriple())) {
|
||||
data.insert(QLatin1String(QBS_ARCHITECTURE), architecture(mainTc->targetAbi()));
|
||||
}
|
||||
data.insert(QLatin1String(QBS_TARGETOS), targetOSList(targetAbi, k));
|
||||
data.insert(QLatin1String(QBS_TARGETPLATFORM), targetPlatform(targetAbi, k));
|
||||
|
||||
QStringList toolchain = toolchainList(mainTc);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user