forked from qt-creator/qt-creator
ToolChainManager: Allow for filtering of toolchains
Allow to provide a Predicate to ToolChainManager::toolChains and add a ToolChainManager::toolChain method. Change-Id: I0849f6fa67ffd8d5c6cfe4253cb0a326e1b023fa Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -275,15 +275,14 @@ static ToolChain *preferredToolChain(BaseQtVersion *qtVersion, const FileName &m
|
||||
{
|
||||
const FileName spec = ms.isEmpty() ? qtVersion->mkspec() : ms;
|
||||
|
||||
QList<ToolChain *> toolchains = ToolChainManager::toolChains();
|
||||
const QList<ToolChain *> toolchains = ToolChainManager::toolChains();
|
||||
QList<Abi> qtAbis = qtVersion->qtAbis();
|
||||
return findOr(toolchains,
|
||||
toolchains.isEmpty() ? 0 : toolchains.first(),
|
||||
[&spec, &archConfig, &qtAbis, &qtVersion](ToolChain *tc) -> bool{
|
||||
return qtAbis.contains(tc->targetAbi())
|
||||
&& tc->suggestedMkspecList().contains(spec)
|
||||
&& QMakeStepConfig::targetArchFor(tc->targetAbi(), qtVersion) == archConfig;
|
||||
});
|
||||
return findOr(toolchains, toolchains.isEmpty() ? nullptr : toolchains.first(),
|
||||
[&](ToolChain *tc) {
|
||||
return qtAbis.contains(tc->targetAbi())
|
||||
&& tc->suggestedMkspecList().contains(spec)
|
||||
&& QMakeStepConfig::targetArchFor(tc->targetAbi(), qtVersion) == archConfig;
|
||||
});
|
||||
}
|
||||
|
||||
Kit *QmakeProjectImporter::createTemporaryKit(const QtProjectImporter::QtVersionData &data,
|
||||
|
||||
Reference in New Issue
Block a user