qmake: Warn when using a mkspec that might not work with the tool chain

Warn when using a mkspec that might or might not work with the selected
tool chain.

Task-number: QTCREATORBUG-5854
Change-Id: Ifead5108ccd109f66707ad7aa371daead8cb57e7
Reviewed-on: http://codereview.qt-project.org/4522
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
Tobias Hunger
2011-09-09 09:54:37 +00:00
parent 28535f7571
commit caa8bd454e
5 changed files with 57 additions and 5 deletions

View File

@@ -537,6 +537,11 @@ QString QMakeStepConfigWidget::summaryText() const
return m_summaryText;
}
QString QMakeStepConfigWidget::additionalSummaryText() const
{
return m_additionalSummaryText;
}
QString QMakeStepConfigWidget::displayName() const
{
return m_step->displayName();
@@ -664,18 +669,24 @@ void QMakeStepConfigWidget::updateSummaryLabel()
Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration();
QtSupport::BaseQtVersion *qtVersion = qt4bc->qtVersion();
if (!qtVersion) {
m_summaryText = tr("<b>qmake:</b> No Qt version set. Cannot run qmake.");
emit updateSummary();
setSummaryText(tr("<b>qmake:</b> No Qt version set. Cannot run qmake."));
return;
}
// We don't want the full path to the .pro file
QString args = m_step->allArguments(true);
// And we only use the .pro filename not the full path
QString program = QFileInfo(qtVersion->qmakeCommand()).fileName();
m_summaryText = tr("<b>qmake:</b> %1 %2").arg(program, args);
emit updateSummary();
setSummaryText(tr("<b>qmake:</b> %1 %2").arg(program, args));
ToolChain *tc = qt4bc->toolChain();
if (!tc)
return;
QString tcSpec = tc->mkspec();
if (!tcSpec.isEmpty() && tcSpec != m_step->mkspec())
setAdditionalSummaryText(tr("<b>Warning:</b> The tool chain suggested \"%1\" as mkspec.").arg(tcSpec));
else
setAdditionalSummaryText(QString());
}
void QMakeStepConfigWidget::updateQmlDebuggingOption()
@@ -723,6 +734,22 @@ void QMakeStepConfigWidget::recompileMessageBoxFinished(int button)
}
}
void QMakeStepConfigWidget::setSummaryText(const QString &text)
{
if (text == m_summaryText)
return;
m_summaryText = text;
emit updateSummary();
}
void QMakeStepConfigWidget::setAdditionalSummaryText(const QString &text)
{
if (text == m_additionalSummaryText)
return;
m_additionalSummaryText = text;
emit updateAdditionalSummary();
}
////
// QMakeStepFactory
////