forked from qt-creator/qt-creator
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:
@@ -136,9 +136,12 @@ public:
|
|||||||
: QWidget()
|
: QWidget()
|
||||||
{}
|
{}
|
||||||
virtual QString summaryText() const = 0;
|
virtual QString summaryText() const = 0;
|
||||||
|
virtual QString additionalSummaryText() const { return QString(); }
|
||||||
virtual QString displayName() const = 0;
|
virtual QString displayName() const = 0;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void updateSummary();
|
void updateSummary();
|
||||||
|
void updateAdditionalSummary();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|||||||
@@ -140,6 +140,19 @@ void BuildStepListWidget::updateSummary()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BuildStepListWidget::updateAdditionalSummary()
|
||||||
|
{
|
||||||
|
BuildStepConfigWidget *widget = qobject_cast<BuildStepConfigWidget *>(sender());
|
||||||
|
if (widget) {
|
||||||
|
foreach (const BuildStepsWidgetData *s, m_buildStepsData) {
|
||||||
|
if (s->widget == widget) {
|
||||||
|
s->detailsWidget->setAdditionalSummaryText(widget->additionalSummaryText());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void BuildStepListWidget::init(BuildStepList *bsl)
|
void BuildStepListWidget::init(BuildStepList *bsl)
|
||||||
{
|
{
|
||||||
Q_ASSERT(bsl);
|
Q_ASSERT(bsl);
|
||||||
@@ -222,6 +235,8 @@ void BuildStepListWidget::addBuildStepWidget(int pos, BuildStep *step)
|
|||||||
|
|
||||||
connect(s->widget, SIGNAL(updateSummary()),
|
connect(s->widget, SIGNAL(updateSummary()),
|
||||||
this, SLOT(updateSummary()));
|
this, SLOT(updateSummary()));
|
||||||
|
connect(s->widget, SIGNAL(updateAdditionalSummary()),
|
||||||
|
this, SLOT(updateAdditionalSummary()));
|
||||||
|
|
||||||
connect(s->upButton, SIGNAL(clicked()),
|
connect(s->upButton, SIGNAL(clicked()),
|
||||||
m_upMapper, SLOT(map()));
|
m_upMapper, SLOT(map()));
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ private slots:
|
|||||||
void triggerAddBuildStep();
|
void triggerAddBuildStep();
|
||||||
void addBuildStep(int pos);
|
void addBuildStep(int pos);
|
||||||
void updateSummary();
|
void updateSummary();
|
||||||
|
void updateAdditionalSummary();
|
||||||
void triggerStepMoveUp(int pos);
|
void triggerStepMoveUp(int pos);
|
||||||
void stepMoved(int from, int to);
|
void stepMoved(int from, int to);
|
||||||
void triggerStepMoveDown(int pos);
|
void triggerStepMoveDown(int pos);
|
||||||
|
|||||||
@@ -537,6 +537,11 @@ QString QMakeStepConfigWidget::summaryText() const
|
|||||||
return m_summaryText;
|
return m_summaryText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString QMakeStepConfigWidget::additionalSummaryText() const
|
||||||
|
{
|
||||||
|
return m_additionalSummaryText;
|
||||||
|
}
|
||||||
|
|
||||||
QString QMakeStepConfigWidget::displayName() const
|
QString QMakeStepConfigWidget::displayName() const
|
||||||
{
|
{
|
||||||
return m_step->displayName();
|
return m_step->displayName();
|
||||||
@@ -664,18 +669,24 @@ void QMakeStepConfigWidget::updateSummaryLabel()
|
|||||||
Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration();
|
Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration();
|
||||||
QtSupport::BaseQtVersion *qtVersion = qt4bc->qtVersion();
|
QtSupport::BaseQtVersion *qtVersion = qt4bc->qtVersion();
|
||||||
if (!qtVersion) {
|
if (!qtVersion) {
|
||||||
m_summaryText = tr("<b>qmake:</b> No Qt version set. Cannot run qmake.");
|
setSummaryText(tr("<b>qmake:</b> No Qt version set. Cannot run qmake."));
|
||||||
emit updateSummary();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We don't want the full path to the .pro file
|
// We don't want the full path to the .pro file
|
||||||
QString args = m_step->allArguments(true);
|
QString args = m_step->allArguments(true);
|
||||||
// And we only use the .pro filename not the full path
|
// And we only use the .pro filename not the full path
|
||||||
QString program = QFileInfo(qtVersion->qmakeCommand()).fileName();
|
QString program = QFileInfo(qtVersion->qmakeCommand()).fileName();
|
||||||
m_summaryText = tr("<b>qmake:</b> %1 %2").arg(program, args);
|
setSummaryText(tr("<b>qmake:</b> %1 %2").arg(program, args));
|
||||||
emit updateSummary();
|
|
||||||
|
|
||||||
|
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()
|
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
|
// QMakeStepFactory
|
||||||
////
|
////
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ public:
|
|||||||
QMakeStepConfigWidget(QMakeStep *step);
|
QMakeStepConfigWidget(QMakeStep *step);
|
||||||
~QMakeStepConfigWidget();
|
~QMakeStepConfigWidget();
|
||||||
QString summaryText() const;
|
QString summaryText() const;
|
||||||
|
QString additionalSummaryText() const;
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
private slots:
|
private slots:
|
||||||
// slots for handling buildconfiguration/step signals
|
// slots for handling buildconfiguration/step signals
|
||||||
@@ -167,9 +168,14 @@ private:
|
|||||||
void updateSummaryLabel();
|
void updateSummaryLabel();
|
||||||
void updateQmlDebuggingOption();
|
void updateQmlDebuggingOption();
|
||||||
void updateEffectiveQMakeCall();
|
void updateEffectiveQMakeCall();
|
||||||
|
|
||||||
|
void setSummaryText(const QString &);
|
||||||
|
void setAdditionalSummaryText(const QString &);
|
||||||
|
|
||||||
Ui::QMakeStep *m_ui;
|
Ui::QMakeStep *m_ui;
|
||||||
QMakeStep *m_step;
|
QMakeStep *m_step;
|
||||||
QString m_summaryText;
|
QString m_summaryText;
|
||||||
|
QString m_additionalSummaryText;
|
||||||
bool m_ignoreChange;
|
bool m_ignoreChange;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user