Merge remote-tracking branch 'origin/4.9'

Change-Id: I801042a53ae4d02d1891ea582ca9ea89b00d3181
This commit is contained in:
Orgad Shaneh
2019-03-01 12:20:57 +02:00
129 changed files with 1253 additions and 709 deletions

View File

@@ -265,19 +265,30 @@ void QmakeProjectImporter::deleteDirectoryData(void *directoryData) const
delete static_cast<DirectoryData *>(directoryData);
}
static ToolChain *preferredToolChain(BaseQtVersion *qtVersion, const FileName &ms,
const QMakeStepConfig::TargetArchConfig &archConfig)
static const QList<ToolChain *> preferredToolChains(BaseQtVersion *qtVersion, const FileName &ms,
const QMakeStepConfig::TargetArchConfig &archConfig)
{
const FileName spec = ms.isEmpty() ? qtVersion->mkspec() : ms;
const QList<ToolChain *> toolchains = ToolChainManager::toolChains();
QList<Abi> qtAbis = qtVersion->qtAbis();
return findOr(toolchains, toolchains.isEmpty() ? nullptr : toolchains.first(),
[&](ToolChain *tc) {
const auto matcher = [&](const ToolChain *tc) {
return qtAbis.contains(tc->targetAbi())
&& tc->suggestedMkspecList().contains(spec)
&& QMakeStepConfig::targetArchFor(tc->targetAbi(), qtVersion) == archConfig;
&& tc->suggestedMkspecList().contains(spec)
&& QMakeStepConfig::targetArchFor(tc->targetAbi(), qtVersion) == archConfig;
};
ToolChain * const cxxToolchain = findOrDefault(toolchains, [matcher](const ToolChain *tc) {
return tc->language() == ProjectExplorer::Constants::CXX_LANGUAGE_ID && matcher(tc);
});
ToolChain * const cToolchain = findOrDefault(toolchains, [matcher](const ToolChain *tc) {
return tc->language() == ProjectExplorer::Constants::C_LANGUAGE_ID && matcher(tc);
});
QList<ToolChain *> chosenToolchains;
for (ToolChain * const tc : {cxxToolchain, cToolchain}) {
if (tc)
chosenToolchains << tc;
};
return chosenToolchains;
}
Kit *QmakeProjectImporter::createTemporaryKit(const QtProjectImporter::QtVersionData &data,
@@ -288,7 +299,8 @@ Kit *QmakeProjectImporter::createTemporaryKit(const QtProjectImporter::QtVersion
Q_UNUSED(osType); // TODO use this to select the right toolchain?
return QtProjectImporter::createTemporaryKit(data,
[&data, parsedSpec, archConfig](Kit *k) -> void {
ToolChainKitAspect::setToolChain(k, preferredToolChain(data.qt, parsedSpec, archConfig));
for (ToolChain * const tc : preferredToolChains(data.qt, parsedSpec, archConfig))
ToolChainKitAspect::setToolChain(k, tc);
if (parsedSpec != data.qt->mkspec())
QmakeKitAspect::setMkspec(k, parsedSpec);
});