forked from qt-creator/qt-creator
iOS: Fix kit creation with Xcode 7
Xcode 7's platform plist does not specify a concrete version for the SDK in the SDK name anymore. So, if we do not find an SDK with the same name, look for an SDK with a version that matches the platform's 'Version' setting. Trying to figure out from the settings looks inherently fragile to me though, and we might be better off just using xcrun -sdk <sdk> --show-sdk-path Change-Id: Ief45f03aa7cd5193f6c24b087eb635d3f5ba5298 Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
@@ -146,6 +146,8 @@ void IosProbe::setupDefaultToolchains(const QString &devPath, const QString &xco
|
||||
continue;
|
||||
}
|
||||
|
||||
const QString platformSdkVersion = infoSettings.value(QLatin1String("Version")).toString();
|
||||
|
||||
// prepare default platform properties
|
||||
QVariantMap defaultProp = infoSettings.value(QLatin1String("DefaultProperties"))
|
||||
.toMap();
|
||||
@@ -225,6 +227,7 @@ void IosProbe::setupDefaultToolchains(const QString &devPath, const QString &xco
|
||||
if (defaultProp.contains(QLatin1String("SDKROOT")))
|
||||
sdkName = defaultProp.value(QLatin1String("SDKROOT")).toString();
|
||||
QString sdkPath;
|
||||
QString sdkPathWithSameVersion;
|
||||
QDir sdks(fInfo.absoluteFilePath() + QLatin1String("/Developer/SDKs"));
|
||||
QString maxVersion;
|
||||
foreach (const QFileInfo &sdkDirInfo, sdks.entryInfoList(QDir::Dirs
|
||||
@@ -249,11 +252,15 @@ void IosProbe::setupDefaultToolchains(const QString &devPath, const QString &xco
|
||||
}
|
||||
} else if (currentSdkName == sdkName) {
|
||||
sdkPath = sdkDirInfo.canonicalFilePath();
|
||||
}
|
||||
} else if (currentSdkName.toString().startsWith(sdkName) /*if sdkName doesn't contain version*/
|
||||
&& compareVersions(platformSdkVersion, versionStr) == 0)
|
||||
sdkPathWithSameVersion = sdkDirInfo.canonicalFilePath();
|
||||
}
|
||||
if (!sdkPath.isEmpty())
|
||||
if (sdkPath.isEmpty())
|
||||
sysRoot = sdkPathWithSameVersion;
|
||||
else
|
||||
sysRoot = sdkPath;
|
||||
else if (!sdkName.isEmpty())
|
||||
if (sysRoot.isEmpty() && !sdkName.isEmpty())
|
||||
qCDebug(probeLog) << indent << QString::fromLatin1("Failed to find sysroot %1").arg(sdkName);
|
||||
}
|
||||
if (hasClang && !sysRoot.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user