Commit aa8998cf authored by Eike Ziller's avatar Eike Ziller

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: default avatarDaniel Teske <daniel.teske@theqtcompany.com>
parent dcab956d
......@@ -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()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment