Merge remote-tracking branch 'origin/4.5' into 4.6

Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri

Change-Id: I6a9838d60dd37d4762fa7a345febc3a59e9d8351
This commit is contained in:
Eike Ziller
2018-03-01 15:44:34 +01:00
6 changed files with 34 additions and 15 deletions

View File

@@ -93,11 +93,23 @@ void QmakeKitInformation::setup(Kit *k)
&& version->qtAbis().contains(t->targetAbi());
});
if (!possibleTcs.isEmpty()) {
ToolChain *possibleTc
= Utils::findOr(possibleTcs, possibleTcs.last(),
[&spec](const ToolChain *t) { return t->suggestedMkspecList().contains(spec); });
if (possibleTc)
ToolChainKitInformation::setAllToolChainsToMatch(k, possibleTc);
const QList<ToolChain *> goodTcs = Utils::filtered(possibleTcs,
[&spec](const ToolChain *t) {
return t->suggestedMkspecList().contains(spec);
});
// Hack to prefer a tool chain from PATH (e.g. autodetected) over other matches.
// This improves the situation a bit if a cross-compilation tool chain has the
// same ABI as the host.
const Environment systemEnvironment = Environment::systemEnvironment();
ToolChain *bestTc = Utils::findOrDefault(goodTcs,
[&systemEnvironment](const ToolChain *t) {
return systemEnvironment.path().contains(t->compilerCommand().parentDir().toString());
});
if (!bestTc) {
bestTc = goodTcs.isEmpty() ? possibleTcs.last() : goodTcs.last();
}
if (bestTc)
ToolChainKitInformation::setAllToolChainsToMatch(k, bestTc);
}
}
}