Qbs: Clean up targetOS calculation for Darwin OSes.

iOS Simulator is now detected correctly instead of making assumptions
based on the architecture that could change in the future (ARM-based
Macs, anyone?).

Change-Id: I6cc78aedf86af3623363d67203fcbc086f0cb6f8
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
Jake Petroules
2014-07-21 01:53:07 -04:00
parent fcc949cc02
commit ede39afa8a

View File

@@ -83,19 +83,21 @@ QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, c
: QStringList() << QLatin1String("msvc")); : QStringList() << QLatin1String("msvc"));
} else if (targetAbi.os() == ProjectExplorer::Abi::MacOS) { } else if (targetAbi.os() == ProjectExplorer::Abi::MacOS) {
const char IOSQT[] = "Qt4ProjectManager.QtVersion.Ios"; // from Ios::Constants (include header?) const char IOSQT[] = "Qt4ProjectManager.QtVersion.Ios"; // from Ios::Constants (include header?)
const char IOS_SIMULATOR_TYPE[] = "Ios.Simulator.Type";
const QtSupport::BaseQtVersion * const qt = QtSupport::QtKitInformation::qtVersion(k); const QtSupport::BaseQtVersion * const qt = QtSupport::QtKitInformation::qtVersion(k);
QStringList targetOS;
targetOS << QLatin1String("darwin") << QLatin1String("bsd4")
<< QLatin1String("bsd") << QLatin1String("unix");
if (qt && qt->type() == QLatin1String(IOSQT)) { if (qt && qt->type() == QLatin1String(IOSQT)) {
QStringList targetOS; targetOS.insert(0, QLatin1String("ios"));
if (targetAbi.architecture() == ProjectExplorer::Abi::X86Architecture) if (ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(k) == IOS_SIMULATOR_TYPE)
targetOS << QLatin1String("ios-simulator"); targetOS.insert(0, QLatin1String("ios-simulator"));
targetOS << QLatin1String("ios") << QLatin1String("darwin")
<< QLatin1String("bsd4") << QLatin1String("bsd") << QLatin1String("unix");
data.insert(QLatin1String(QBS_TARGETOS), targetOS);
} else { } else {
data.insert(QLatin1String(QBS_TARGETOS), QStringList() << QLatin1String("osx") targetOS.insert(0, QLatin1String("osx"));
<< QLatin1String("darwin") << QLatin1String("bsd4")
<< QLatin1String("bsd") << QLatin1String("unix"));
} }
data.insert(QLatin1String(QBS_TARGETOS), targetOS);
if (tc->type() != QLatin1String("clang")) { if (tc->type() != QLatin1String("clang")) {
data.insert(QLatin1String(QBS_TOOLCHAIN), QLatin1String("gcc")); data.insert(QLatin1String(QBS_TOOLCHAIN), QLatin1String("gcc"));
} else { } else {