Commit 6758b78b authored by Ulf Hermann's avatar Ulf Hermann

Qmake: Add an option to put debug info into separate files

Also, prepare for setting this automatically once we get a
distinct "Profile" build configuration.

Task-number: QTCREATORBUG-14009
Change-Id: I70556806e33d47341360231aeff844e490675f6a
Reviewed-by: default avatarLeena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: default avatarDaniel Teske <daniel.teske@theqtcompany.com>
parent d63624af
......@@ -67,6 +67,7 @@ const char QMAKE_BS_ID[] = "QtProjectManager.QMakeBuildStep";
const char QMAKE_ARGUMENTS_KEY[] = "QtProjectManager.QMakeBuildStep.QMakeArguments";
const char QMAKE_FORCED_KEY[] = "QtProjectManager.QMakeBuildStep.QMakeForced";
const char QMAKE_USE_QTQUICKCOMPILER[] = "QtProjectManager.QMakeBuildStep.UseQtQuickCompiler";
const char QMAKE_SEPARATEDEBUGINFO_KEY[] = "QtProjectManager.QMakeBuildStep.SeparateDebugInfo";
const char QMAKE_QMLDEBUGLIBAUTO_KEY[] = "QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto";
const char QMAKE_QMLDEBUGLIB_KEY[] = "QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary";
}
......@@ -76,7 +77,8 @@ QMakeStep::QMakeStep(BuildStepList *bsl) :
m_forced(false),
m_needToRunQMake(false),
m_linkQmlDebuggingLibrary(DebugLink),
m_useQtQuickCompiler(false)
m_useQtQuickCompiler(false),
m_separateDebugInfo(false)
{
ctor();
}
......@@ -85,7 +87,8 @@ QMakeStep::QMakeStep(BuildStepList *bsl, Core::Id id) :
AbstractProcessStep(bsl, id),
m_forced(false),
m_linkQmlDebuggingLibrary(DebugLink),
m_useQtQuickCompiler(false)
m_useQtQuickCompiler(false),
m_separateDebugInfo(false)
{
ctor();
}
......@@ -95,7 +98,8 @@ QMakeStep::QMakeStep(BuildStepList *bsl, QMakeStep *bs) :
m_forced(bs->m_forced),
m_userArgs(bs->m_userArgs),
m_linkQmlDebuggingLibrary(bs->m_linkQmlDebuggingLibrary),
m_useQtQuickCompiler(bs->m_useQtQuickCompiler)
m_useQtQuickCompiler(bs->m_useQtQuickCompiler),
m_separateDebugInfo(bs->m_separateDebugInfo)
{
ctor();
}
......@@ -187,6 +191,11 @@ QStringList QMakeStep::deducedArguments()
if (useQtQuickCompiler() && version)
arguments << QLatin1String("CONFIG+=qtquickcompiler");
if (separateDebugInfo()) {
arguments << QLatin1String("CONFIG+=force_debug_info")
<< QLatin1String("CONFIG+=separate_debug_info");
}
return arguments;
}
......@@ -393,6 +402,23 @@ void QMakeStep::setUseQtQuickCompiler(bool enable)
qmakeBuildConfiguration()->emitProFileEvaluateNeeded();
}
bool QMakeStep::separateDebugInfo() const
{
return m_separateDebugInfo;
}
void QMakeStep::setSeparateDebugInfo(bool enable)
{
if (enable == m_separateDebugInfo)
return;
m_separateDebugInfo = enable;
emit separateDebugInfoChanged();
qmakeBuildConfiguration()->emitQMakeBuildConfigurationChanged();
qmakeBuildConfiguration()->emitProFileEvaluateNeeded();
}
QStringList QMakeStep::parserArguments()
{
QStringList result;
......@@ -428,6 +454,7 @@ QVariantMap QMakeStep::toMap() const
map.insert(QLatin1String(QMAKE_QMLDEBUGLIB_KEY), m_linkQmlDebuggingLibrary == DoLink);
map.insert(QLatin1String(QMAKE_FORCED_KEY), m_forced);
map.insert(QLatin1String(QMAKE_USE_QTQUICKCOMPILER), m_useQtQuickCompiler);
map.insert(QLatin1String(QMAKE_SEPARATEDEBUGINFO_KEY), m_separateDebugInfo);
return map;
}
......@@ -444,6 +471,7 @@ bool QMakeStep::fromMap(const QVariantMap &map)
else
m_linkQmlDebuggingLibrary = DoNotLink;
}
m_separateDebugInfo = map.value(QLatin1String(QMAKE_SEPARATEDEBUGINFO_KEY), false).toBool();
return BuildStep::fromMap(map);
}
......@@ -461,6 +489,7 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step)
m_ui->qmakeAdditonalArgumentsLineEdit->setText(m_step->userArguments());
m_ui->qmlDebuggingLibraryCheckBox->setChecked(m_step->linkQmlDebuggingLibrary());
m_ui->qtQuickCompilerCheckBox->setChecked(m_step->useQtQuickCompiler());
m_ui->separateDebugInfoCheckBox->setChecked(m_step->separateDebugInfo());
qmakeBuildConfigChanged();
......@@ -481,6 +510,10 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step)
this, &QMakeStepConfigWidget::useQtQuickCompilerChecked);
connect(m_ui->qtQuickCompilerCheckBox, &QCheckBox::clicked,
this, &QMakeStepConfigWidget::askForRebuild);
connect(m_ui->separateDebugInfoCheckBox, &QAbstractButton::toggled,
this, &QMakeStepConfigWidget::separateDebugInfoChecked);
connect(m_ui->separateDebugInfoCheckBox, &QCheckBox::clicked,
this, &QMakeStepConfigWidget::askForRebuild);
connect(step, SIGNAL(userArgumentsChanged()),
this, SLOT(userArgumentsChanged()));
connect(step, SIGNAL(linkQmlDebuggingLibraryChanged()),
......@@ -489,6 +522,8 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step)
this, &QMakeStepConfigWidget::linkQmlDebuggingLibraryChanged);
connect(step, &QMakeStep::useQtQuickCompilerChanged,
this, &QMakeStepConfigWidget::useQtQuickCompilerChanged);
connect(step, &QMakeStep::separateDebugInfoChanged,
this, &QMakeStepConfigWidget::separateDebugInfoChanged);
connect(step->qmakeBuildConfiguration(), SIGNAL(qmakeBuildConfigurationChanged()),
this, SLOT(qmakeBuildConfigChanged()));
connect(step->target(), SIGNAL(kitChanged()), this, SLOT(qtVersionChanged()));
......@@ -566,6 +601,15 @@ void QMakeStepConfigWidget::useQtQuickCompilerChanged()
updateQmlDebuggingOption();
}
void QMakeStepConfigWidget::separateDebugInfoChanged()
{
if (m_ignoreChange)
return;
updateSummaryLabel();
updateEffectiveQMakeCall();
}
void QMakeStepConfigWidget::qmakeArgumentsLineEdited()
{
m_ignoreChange = true;
......@@ -635,6 +679,19 @@ void QMakeStepConfigWidget::useQtQuickCompilerChecked(bool checked)
updateQtQuickCompilerOption();
}
void QMakeStepConfigWidget::separateDebugInfoChecked(bool checked)
{
if (m_ignoreChange)
return;
m_ignoreChange = true;
m_step->setSeparateDebugInfo(checked);
m_ignoreChange = false;
updateSummaryLabel();
updateEffectiveQMakeCall();
}
void QMakeStepConfigWidget::updateSummaryLabel()
{
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(m_step->target()->kit());
......
......@@ -114,6 +114,8 @@ public:
void setLinkQmlDebuggingLibrary(bool enable);
bool useQtQuickCompiler() const;
void setUseQtQuickCompiler(bool enable);
bool separateDebugInfo() const;
void setSeparateDebugInfo(bool enable);
QVariantMap toMap() const;
......@@ -121,6 +123,7 @@ signals:
void userArgumentsChanged();
void linkQmlDebuggingLibraryChanged();
void useQtQuickCompilerChanged();
void separateDebugInfoChanged();
protected:
QMakeStep(ProjectExplorer::BuildStepList *parent, QMakeStep *source);
......@@ -140,6 +143,7 @@ private:
QmlLibraryLink m_linkQmlDebuggingLibrary;
bool m_useQtQuickCompiler;
bool m_scriptTemplate;
bool m_separateDebugInfo;
};
......@@ -159,12 +163,14 @@ private slots:
void userArgumentsChanged();
void linkQmlDebuggingLibraryChanged();
void useQtQuickCompilerChanged();
void separateDebugInfoChanged();
// slots for dealing with user changes in our UI
void qmakeArgumentsLineEdited();
void buildConfigurationSelected();
void linkQmlDebuggingLibraryChecked(bool checked);
void useQtQuickCompilerChecked(bool checked);
void separateDebugInfoChecked(bool checked);
void askForRebuild();
private slots:
......
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>440</width>
<height>201</height>
<height>250</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
......@@ -27,7 +27,7 @@
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="label_0">
<property name="text">
<string>qmake build configuration:</string>
</property>
......@@ -35,7 +35,7 @@
</item>
<item row="0" column="1">
<widget class="QWidget" name="buildConfigurrationWidget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<layout class="QHBoxLayout" name="horizontalLayout_0">
<property name="leftMargin">
<number>0</number>
</property>
......@@ -95,15 +95,60 @@
<widget class="QLineEdit" name="qmakeAdditonalArgumentsLineEdit"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="separateDebugInfoLabel">
<property name="text">
<string>Generate separate debug info:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QWidget" name="widget_2" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="separateDebugInfoCheckBox">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="debuggingLibraryLabel">
<property name="text">
<string>Link QML debugging library:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<item row="3" column="1">
<widget class="QWidget" name="widget_3" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
......@@ -138,7 +183,7 @@
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
......@@ -153,15 +198,15 @@
</layout>
</widget>
</item>
<item row="3" column="0">
<item row="4" column="0">
<widget class="QLabel" name="qtQuickCompilerLabel">
<property name="text">
<string>Use QML compiler:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QWidget" name="widget_3" native="true">
<item row="4" column="1">
<widget class="QWidget" name="widget_4" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="leftMargin">
<number>0</number>
......@@ -197,7 +242,7 @@
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
......@@ -212,7 +257,7 @@
</layout>
</widget>
</item>
<item row="4" column="0">
<item row="5" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Effective qmake call:</string>
......@@ -222,7 +267,7 @@
</property>
</widget>
</item>
<item row="4" column="1">
<item row="5" column="1">
<widget class="QPlainTextEdit" name="qmakeArgumentsEdit">
<property name="enabled">
<bool>true</bool>
......
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