forked from qt-creator/qt-creator
qmake: Skip running qmake when using non-default tool chains
Do not rerun qmake when using a tool chain which requires a non-standard mkspec to be used. Change-Id: I6171790805743251a7867111faa46bd4d4cc890d Reviewed-on: http://codereview.qt.nokia.com/314 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
@@ -121,7 +121,6 @@ Qt4BuildConfiguration *QMakeStep::qt4BuildConfiguration() const
|
||||
/// user arguments
|
||||
QString QMakeStep::allArguments(bool shorted)
|
||||
{
|
||||
QString additonalArguments = m_userArgs;
|
||||
Qt4BuildConfiguration *bc = qt4BuildConfiguration();
|
||||
QStringList arguments;
|
||||
if (bc->subNodeBuild())
|
||||
@@ -131,24 +130,19 @@ QString QMakeStep::allArguments(bool shorted)
|
||||
buildConfiguration()->target()->project()->file()->fileName()).fileName());
|
||||
else
|
||||
arguments << QDir::toNativeSeparators(buildConfiguration()->target()->project()->file()->fileName());
|
||||
|
||||
arguments << "-r";
|
||||
|
||||
bool haveSpec = false;
|
||||
for (Utils::QtcProcess::ArgIterator ait(&additonalArguments); ait.next(); )
|
||||
if (ait.value() == QLatin1String("-spec"))
|
||||
haveSpec = true;
|
||||
|
||||
if (!haveSpec) {
|
||||
const QString tcSpec = bc->toolChain() ? bc->toolChain()->mkspec() : QString();
|
||||
if (tcSpec.isEmpty()) {
|
||||
if (bc->qtVersion())
|
||||
arguments << "-spec" << bc->qtVersion()->mkspec();
|
||||
} else if (!bc->qtVersion() || bc->qtVersion()->hasMkspec(tcSpec)) {
|
||||
arguments << "-spec" << tcSpec;
|
||||
} else {
|
||||
arguments << "-spec" << bc->qtVersion()->mkspec();
|
||||
bool userProvidedMkspec = false;
|
||||
for (Utils::QtcProcess::ConstArgIterator ait(&m_userArgs); ait.next(); ) {
|
||||
if (ait.value() == QLatin1String("-spec")) {
|
||||
if (ait.next()) {
|
||||
userProvidedMkspec = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!userProvidedMkspec)
|
||||
arguments << "-spec" << mkspec();
|
||||
|
||||
// Find out what flags we pass on to qmake
|
||||
arguments << bc->configCommandLineArguments();
|
||||
@@ -156,7 +150,7 @@ QString QMakeStep::allArguments(bool shorted)
|
||||
arguments << moreArguments();
|
||||
|
||||
QString args = Utils::QtcProcess::joinArgs(arguments);
|
||||
Utils::QtcProcess::addArgs(&args, additonalArguments);
|
||||
Utils::QtcProcess::addArgs(&args, m_userArgs);
|
||||
return args;
|
||||
}
|
||||
|
||||
@@ -434,6 +428,25 @@ QString QMakeStep::userArguments()
|
||||
return m_userArgs;
|
||||
}
|
||||
|
||||
QString QMakeStep::mkspec()
|
||||
{
|
||||
Qt4BuildConfiguration *bc = qt4BuildConfiguration();
|
||||
QString additionalArguments = m_userArgs;
|
||||
for (Utils::QtcProcess::ArgIterator ait(&additionalArguments); ait.next(); ) {
|
||||
if (ait.value() == QLatin1String("-spec")) {
|
||||
if (ait.next())
|
||||
return ait.value();
|
||||
}
|
||||
}
|
||||
|
||||
const QString tcSpec = bc->toolChain() ? bc->toolChain()->mkspec() : QString();
|
||||
if (!bc->qtVersion())
|
||||
return tcSpec;
|
||||
if (!tcSpec.isEmpty() && bc->qtVersion()->hasMkspec(tcSpec))
|
||||
return tcSpec;
|
||||
return bc->qtVersion()->mkspec();
|
||||
}
|
||||
|
||||
QVariantMap QMakeStep::toMap() const
|
||||
{
|
||||
QVariantMap map(AbstractProcessStep::toMap());
|
||||
|
||||
Reference in New Issue
Block a user