Commit d94092a0 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Find better tool chain when importing a build



Task-number: QTCREATORBUG-6411
Change-Id: I961c49b7b5bbf571eecff8f12f9df78faa65f40a
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent 4abf51d1
...@@ -402,8 +402,26 @@ Qt4BuildConfiguration *Qt4BaseTarget::addQt4BuildConfiguration(QString defaultDi ...@@ -402,8 +402,26 @@ Qt4BuildConfiguration *Qt4BaseTarget::addQt4BuildConfiguration(QString defaultDi
bc->setQtVersion(qtversion); bc->setQtVersion(qtversion);
if (!directory.isEmpty()) if (!directory.isEmpty())
bc->setShadowBuildAndDirectory(directory != project()->projectDirectory(), directory); bc->setShadowBuildAndDirectory(directory != project()->projectDirectory(), directory);
addBuildConfiguration(bc); addBuildConfiguration(bc);
Utils::FileName extractedMkspec
= Qt4BuildConfiguration::extractSpecFromArguments(&additionalArguments,
directory, qtversion);
// Find a good tool chain for the mkspec we extracted from the build (rely on default behavior
// if no -spec argument was given or it is the default).
if (!extractedMkspec.isEmpty()
&& extractedMkspec != Utils::FileName::fromString(QLatin1String("default"))
&& extractedMkspec != qtversion->mkspec()) {
QList<ProjectExplorer::ToolChain *> tcList = bc->target()->possibleToolChains(bc);
foreach (ProjectExplorer::ToolChain *tc, tcList) {
if (tc->mkspecList().contains(extractedMkspec)) {
bc->setToolChain(tc);
qmakeStep->setUserArguments(additionalArguments); // remove unnecessary -spec
}
}
}
return bc; return bc;
} }
......
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