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: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2015-02-19 17:22:24 +01:00
parent d63624afe0
commit 6758b78ba6
3 changed files with 124 additions and 16 deletions

View File

@@ -67,6 +67,7 @@ const char QMAKE_BS_ID[] = "QtProjectManager.QMakeBuildStep";
const char QMAKE_ARGUMENTS_KEY[] = "QtProjectManager.QMakeBuildStep.QMakeArguments"; const char QMAKE_ARGUMENTS_KEY[] = "QtProjectManager.QMakeBuildStep.QMakeArguments";
const char QMAKE_FORCED_KEY[] = "QtProjectManager.QMakeBuildStep.QMakeForced"; const char QMAKE_FORCED_KEY[] = "QtProjectManager.QMakeBuildStep.QMakeForced";
const char QMAKE_USE_QTQUICKCOMPILER[] = "QtProjectManager.QMakeBuildStep.UseQtQuickCompiler"; 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_QMLDEBUGLIBAUTO_KEY[] = "QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto";
const char QMAKE_QMLDEBUGLIB_KEY[] = "QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary"; const char QMAKE_QMLDEBUGLIB_KEY[] = "QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary";
} }
@@ -76,7 +77,8 @@ QMakeStep::QMakeStep(BuildStepList *bsl) :
m_forced(false), m_forced(false),
m_needToRunQMake(false), m_needToRunQMake(false),
m_linkQmlDebuggingLibrary(DebugLink), m_linkQmlDebuggingLibrary(DebugLink),
m_useQtQuickCompiler(false) m_useQtQuickCompiler(false),
m_separateDebugInfo(false)
{ {
ctor(); ctor();
} }
@@ -85,7 +87,8 @@ QMakeStep::QMakeStep(BuildStepList *bsl, Core::Id id) :
AbstractProcessStep(bsl, id), AbstractProcessStep(bsl, id),
m_forced(false), m_forced(false),
m_linkQmlDebuggingLibrary(DebugLink), m_linkQmlDebuggingLibrary(DebugLink),
m_useQtQuickCompiler(false) m_useQtQuickCompiler(false),
m_separateDebugInfo(false)
{ {
ctor(); ctor();
} }
@@ -95,7 +98,8 @@ QMakeStep::QMakeStep(BuildStepList *bsl, QMakeStep *bs) :
m_forced(bs->m_forced), m_forced(bs->m_forced),
m_userArgs(bs->m_userArgs), m_userArgs(bs->m_userArgs),
m_linkQmlDebuggingLibrary(bs->m_linkQmlDebuggingLibrary), m_linkQmlDebuggingLibrary(bs->m_linkQmlDebuggingLibrary),
m_useQtQuickCompiler(bs->m_useQtQuickCompiler) m_useQtQuickCompiler(bs->m_useQtQuickCompiler),
m_separateDebugInfo(bs->m_separateDebugInfo)
{ {
ctor(); ctor();
} }
@@ -187,6 +191,11 @@ QStringList QMakeStep::deducedArguments()
if (useQtQuickCompiler() && version) if (useQtQuickCompiler() && version)
arguments << QLatin1String("CONFIG+=qtquickcompiler"); arguments << QLatin1String("CONFIG+=qtquickcompiler");
if (separateDebugInfo()) {
arguments << QLatin1String("CONFIG+=force_debug_info")
<< QLatin1String("CONFIG+=separate_debug_info");
}
return arguments; return arguments;
} }
@@ -393,6 +402,23 @@ void QMakeStep::setUseQtQuickCompiler(bool enable)
qmakeBuildConfiguration()->emitProFileEvaluateNeeded(); 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 QMakeStep::parserArguments()
{ {
QStringList result; QStringList result;
@@ -428,6 +454,7 @@ QVariantMap QMakeStep::toMap() const
map.insert(QLatin1String(QMAKE_QMLDEBUGLIB_KEY), m_linkQmlDebuggingLibrary == DoLink); map.insert(QLatin1String(QMAKE_QMLDEBUGLIB_KEY), m_linkQmlDebuggingLibrary == DoLink);
map.insert(QLatin1String(QMAKE_FORCED_KEY), m_forced); map.insert(QLatin1String(QMAKE_FORCED_KEY), m_forced);
map.insert(QLatin1String(QMAKE_USE_QTQUICKCOMPILER), m_useQtQuickCompiler); map.insert(QLatin1String(QMAKE_USE_QTQUICKCOMPILER), m_useQtQuickCompiler);
map.insert(QLatin1String(QMAKE_SEPARATEDEBUGINFO_KEY), m_separateDebugInfo);
return map; return map;
} }
@@ -444,6 +471,7 @@ bool QMakeStep::fromMap(const QVariantMap &map)
else else
m_linkQmlDebuggingLibrary = DoNotLink; m_linkQmlDebuggingLibrary = DoNotLink;
} }
m_separateDebugInfo = map.value(QLatin1String(QMAKE_SEPARATEDEBUGINFO_KEY), false).toBool();
return BuildStep::fromMap(map); return BuildStep::fromMap(map);
} }
@@ -461,6 +489,7 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step)
m_ui->qmakeAdditonalArgumentsLineEdit->setText(m_step->userArguments()); m_ui->qmakeAdditonalArgumentsLineEdit->setText(m_step->userArguments());
m_ui->qmlDebuggingLibraryCheckBox->setChecked(m_step->linkQmlDebuggingLibrary()); m_ui->qmlDebuggingLibraryCheckBox->setChecked(m_step->linkQmlDebuggingLibrary());
m_ui->qtQuickCompilerCheckBox->setChecked(m_step->useQtQuickCompiler()); m_ui->qtQuickCompilerCheckBox->setChecked(m_step->useQtQuickCompiler());
m_ui->separateDebugInfoCheckBox->setChecked(m_step->separateDebugInfo());
qmakeBuildConfigChanged(); qmakeBuildConfigChanged();
@@ -481,6 +510,10 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step)
this, &QMakeStepConfigWidget::useQtQuickCompilerChecked); this, &QMakeStepConfigWidget::useQtQuickCompilerChecked);
connect(m_ui->qtQuickCompilerCheckBox, &QCheckBox::clicked, connect(m_ui->qtQuickCompilerCheckBox, &QCheckBox::clicked,
this, &QMakeStepConfigWidget::askForRebuild); 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()), connect(step, SIGNAL(userArgumentsChanged()),
this, SLOT(userArgumentsChanged())); this, SLOT(userArgumentsChanged()));
connect(step, SIGNAL(linkQmlDebuggingLibraryChanged()), connect(step, SIGNAL(linkQmlDebuggingLibraryChanged()),
@@ -489,6 +522,8 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step)
this, &QMakeStepConfigWidget::linkQmlDebuggingLibraryChanged); this, &QMakeStepConfigWidget::linkQmlDebuggingLibraryChanged);
connect(step, &QMakeStep::useQtQuickCompilerChanged, connect(step, &QMakeStep::useQtQuickCompilerChanged,
this, &QMakeStepConfigWidget::useQtQuickCompilerChanged); this, &QMakeStepConfigWidget::useQtQuickCompilerChanged);
connect(step, &QMakeStep::separateDebugInfoChanged,
this, &QMakeStepConfigWidget::separateDebugInfoChanged);
connect(step->qmakeBuildConfiguration(), SIGNAL(qmakeBuildConfigurationChanged()), connect(step->qmakeBuildConfiguration(), SIGNAL(qmakeBuildConfigurationChanged()),
this, SLOT(qmakeBuildConfigChanged())); this, SLOT(qmakeBuildConfigChanged()));
connect(step->target(), SIGNAL(kitChanged()), this, SLOT(qtVersionChanged())); connect(step->target(), SIGNAL(kitChanged()), this, SLOT(qtVersionChanged()));
@@ -566,6 +601,15 @@ void QMakeStepConfigWidget::useQtQuickCompilerChanged()
updateQmlDebuggingOption(); updateQmlDebuggingOption();
} }
void QMakeStepConfigWidget::separateDebugInfoChanged()
{
if (m_ignoreChange)
return;
updateSummaryLabel();
updateEffectiveQMakeCall();
}
void QMakeStepConfigWidget::qmakeArgumentsLineEdited() void QMakeStepConfigWidget::qmakeArgumentsLineEdited()
{ {
m_ignoreChange = true; m_ignoreChange = true;
@@ -635,6 +679,19 @@ void QMakeStepConfigWidget::useQtQuickCompilerChecked(bool checked)
updateQtQuickCompilerOption(); 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() void QMakeStepConfigWidget::updateSummaryLabel()
{ {
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(m_step->target()->kit()); QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(m_step->target()->kit());

View File

@@ -114,6 +114,8 @@ public:
void setLinkQmlDebuggingLibrary(bool enable); void setLinkQmlDebuggingLibrary(bool enable);
bool useQtQuickCompiler() const; bool useQtQuickCompiler() const;
void setUseQtQuickCompiler(bool enable); void setUseQtQuickCompiler(bool enable);
bool separateDebugInfo() const;
void setSeparateDebugInfo(bool enable);
QVariantMap toMap() const; QVariantMap toMap() const;
@@ -121,6 +123,7 @@ signals:
void userArgumentsChanged(); void userArgumentsChanged();
void linkQmlDebuggingLibraryChanged(); void linkQmlDebuggingLibraryChanged();
void useQtQuickCompilerChanged(); void useQtQuickCompilerChanged();
void separateDebugInfoChanged();
protected: protected:
QMakeStep(ProjectExplorer::BuildStepList *parent, QMakeStep *source); QMakeStep(ProjectExplorer::BuildStepList *parent, QMakeStep *source);
@@ -140,6 +143,7 @@ private:
QmlLibraryLink m_linkQmlDebuggingLibrary; QmlLibraryLink m_linkQmlDebuggingLibrary;
bool m_useQtQuickCompiler; bool m_useQtQuickCompiler;
bool m_scriptTemplate; bool m_scriptTemplate;
bool m_separateDebugInfo;
}; };
@@ -159,12 +163,14 @@ private slots:
void userArgumentsChanged(); void userArgumentsChanged();
void linkQmlDebuggingLibraryChanged(); void linkQmlDebuggingLibraryChanged();
void useQtQuickCompilerChanged(); void useQtQuickCompilerChanged();
void separateDebugInfoChanged();
// slots for dealing with user changes in our UI // slots for dealing with user changes in our UI
void qmakeArgumentsLineEdited(); void qmakeArgumentsLineEdited();
void buildConfigurationSelected(); void buildConfigurationSelected();
void linkQmlDebuggingLibraryChecked(bool checked); void linkQmlDebuggingLibraryChecked(bool checked);
void useQtQuickCompilerChecked(bool checked); void useQtQuickCompilerChecked(bool checked);
void separateDebugInfoChecked(bool checked);
void askForRebuild(); void askForRebuild();
private slots: private slots:

View File

@@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>440</width> <width>440</width>
<height>201</height> <height>250</height>
</rect> </rect>
</property> </property>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
@@ -27,7 +27,7 @@
<number>0</number> <number>0</number>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_0">
<property name="text"> <property name="text">
<string>qmake build configuration:</string> <string>qmake build configuration:</string>
</property> </property>
@@ -35,7 +35,7 @@
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QWidget" name="buildConfigurrationWidget" native="true"> <widget class="QWidget" name="buildConfigurrationWidget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_0">
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
@@ -95,15 +95,60 @@
<widget class="QLineEdit" name="qmakeAdditonalArgumentsLineEdit"/> <widget class="QLineEdit" name="qmakeAdditonalArgumentsLineEdit"/>
</item> </item>
<item row="2" column="0"> <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"> <widget class="QLabel" name="debuggingLibraryLabel">
<property name="text"> <property name="text">
<string>Link QML debugging library:</string> <string>Link QML debugging library:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="3" column="1">
<widget class="QWidget" name="widget" native="true"> <widget class="QWidget" name="widget_3" native="true">
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
@@ -138,7 +183,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer"> <spacer name="horizontalSpacer_3">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@@ -153,15 +198,15 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="4" column="0">
<widget class="QLabel" name="qtQuickCompilerLabel"> <widget class="QLabel" name="qtQuickCompilerLabel">
<property name="text"> <property name="text">
<string>Use QML compiler:</string> <string>Use QML compiler:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="4" column="1">
<widget class="QWidget" name="widget_3" native="true"> <widget class="QWidget" name="widget_4" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
@@ -197,7 +242,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_3"> <spacer name="horizontalSpacer_4">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@@ -212,7 +257,7 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item row="5" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Effective qmake call:</string> <string>Effective qmake call:</string>
@@ -222,7 +267,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="5" column="1">
<widget class="QPlainTextEdit" name="qmakeArgumentsEdit"> <widget class="QPlainTextEdit" name="qmakeArgumentsEdit">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>