Commit 2fb8e135 authored by Tobias Hunger's avatar Tobias Hunger

Qt: Pick tool chain that works with the default mkspec

Pick a tool chain that suggests the same mkspec as the Qt version
was build with if possible.

This should help with the case of us choosing the wrong tool chain
on mac.

Change-Id: I206658fd36f2f3c2223392a2c69cf264b5b6a54e
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent a9103d92
......@@ -292,6 +292,20 @@ QList<ProjectExplorer::ToolChain *> Qt4BaseTarget::possibleToolChains(ProjectExp
return result;
}
ProjectExplorer::ToolChain *Qt4BaseTarget::preferredToolChain(ProjectExplorer::BuildConfiguration *bc) const
{
Qt4BuildConfiguration *qtBc = qobject_cast<Qt4BuildConfiguration *>(bc);
if (!qtBc || !qtBc->qtVersion())
return Target::preferredToolChain(bc);
QList<ProjectExplorer::ToolChain *> tcs = possibleToolChains(bc);
const QString mkspec = qtBc->qtVersion()->mkspec();
foreach (ProjectExplorer::ToolChain *tc, tcs)
if (tc->mkspec() == mkspec)
return tc;
return tcs.isEmpty() ? 0 : tcs.at(0);
}
void Qt4BaseTarget::removeUnconfiguredCustomExectutableRunConfigurations()
{
if (runConfigurations().count()) {
......
......@@ -90,6 +90,7 @@ public:
virtual QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Node *n) = 0;
QList<ProjectExplorer::ToolChain *> possibleToolChains(ProjectExplorer::BuildConfiguration *bc) const;
ProjectExplorer::ToolChain *preferredToolChain(ProjectExplorer::BuildConfiguration *) const;
signals:
void buildDirectoryInitialized();
......
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