forked from qt-creator/qt-creator
QMake: Let the user decide whether to run a make step for subdir builds
Amends 66237a6e04
.
Fixes: QTCREATORBUG-22956
Change-Id: I1c611a281eb0c2bad1f066a9753e685595b1eee1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
@@ -375,6 +375,15 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
|
||||
m_ui = new Internal::Ui::MakeStep;
|
||||
m_ui->setupUi(this);
|
||||
|
||||
if (!makeStep->disablingForSubdirsSupported()) {
|
||||
m_ui->disableInSubDirsLabel->hide();
|
||||
m_ui->disableInSubDirsCheckBox->hide();
|
||||
} else {
|
||||
connect(m_ui->disableInSubDirsCheckBox, &QCheckBox::toggled, this, [this] {
|
||||
m_makeStep->setEnabledForSubDirs(!m_ui->disableInSubDirsCheckBox->isChecked());
|
||||
});
|
||||
}
|
||||
|
||||
const auto availableTargets = makeStep->availableTargets();
|
||||
for (const QString &target : availableTargets) {
|
||||
auto item = new QListWidgetItem(target, m_ui->targetsList);
|
||||
@@ -472,6 +481,7 @@ void MakeStepConfigWidget::updateDetails()
|
||||
m_makeStep->jobCountOverridesMakeflags() ? Qt::Checked : Qt::Unchecked);
|
||||
m_ui->nonOverrideWarning->setVisible(m_makeStep->makeflagsJobCountMismatch()
|
||||
&& !m_makeStep->jobCountOverridesMakeflags());
|
||||
m_ui->disableInSubDirsCheckBox->setChecked(!m_makeStep->enabledForSubDirs());
|
||||
|
||||
ProcessParameters param;
|
||||
param.setMacroExpander(bc->macroExpander());
|
||||
|
@@ -79,10 +79,15 @@ public:
|
||||
bool userArgsContainsJobCount() const;
|
||||
bool makeflagsJobCountMismatch() const;
|
||||
|
||||
bool disablingForSubdirsSupported() const { return m_disablingForSubDirsSupported; }
|
||||
bool enabledForSubDirs() const { return m_enabledForSubDirs; }
|
||||
void setEnabledForSubDirs(bool enabled) { m_enabledForSubDirs = enabled; }
|
||||
|
||||
Utils::Environment environment(BuildConfiguration *bc) const;
|
||||
|
||||
protected:
|
||||
bool fromMap(const QVariantMap &map) override;
|
||||
void supportDisablingForSubdirs() { m_disablingForSubDirsSupported = true; }
|
||||
|
||||
private:
|
||||
QVariantMap toMap() const override;
|
||||
@@ -96,6 +101,8 @@ private:
|
||||
int m_userJobCount = 4;
|
||||
bool m_overrideMakeflags = false;
|
||||
bool m_clean = false;
|
||||
bool m_disablingForSubDirsSupported = false;
|
||||
bool m_enabledForSubDirs = true;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT MakeStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>399</width>
|
||||
<width>422</width>
|
||||
<height>279</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -59,7 +59,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="targetsLabel">
|
||||
<property name="text">
|
||||
<string>Targets:</string>
|
||||
@@ -69,7 +69,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="4" column="1">
|
||||
<widget class="QListWidget" name="targetsList"/>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
@@ -100,6 +100,23 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="disableInSubDirsLabel">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Disable in subdirectories:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="disableInSubDirsCheckBox">
|
||||
<property name="toolTip">
|
||||
<string>Runs this step only for a top-level build.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
|
@@ -60,6 +60,7 @@ QmakeMakeStep::QmakeMakeStep(BuildStepList *bsl)
|
||||
setClean(true);
|
||||
setUserArguments("clean");
|
||||
}
|
||||
supportDisablingForSubdirs();
|
||||
}
|
||||
|
||||
bool QmakeMakeStep::init()
|
||||
@@ -79,8 +80,7 @@ bool QmakeMakeStep::init()
|
||||
}
|
||||
|
||||
// Ignore all but the first make step for a non-top-level build. See QTCREATORBUG-15794.
|
||||
m_ignoredNonTopLevelBuild = (bc->fileNodeBuild() || bc->subNodeBuild())
|
||||
&& stepList()->firstOfType<QmakeMakeStep>() != this;
|
||||
m_ignoredNonTopLevelBuild = (bc->fileNodeBuild() || bc->subNodeBuild()) && !enabledForSubDirs();
|
||||
|
||||
ProcessParameters *pp = processParameters();
|
||||
pp->setMacroExpander(bc->macroExpander());
|
||||
|
Reference in New Issue
Block a user