Autotools: Simplify make step setup

The extra inheritance level is not needed (and used nowhere else), and
all special default arguments can be determined from the kind of build list.

Change-Id: I5ab9987d7b1fd8e5999b7c4c8796c2c24db03821
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2018-10-22 18:09:56 +02:00
parent 1c6c64df20
commit 8471ce4331
3 changed files with 12 additions and 20 deletions

View File

@@ -43,27 +43,20 @@ const char MAKE_STEP_ID[] = "AutotoolsProjectManager.MakeStep";
MakeStepFactory::MakeStepFactory()
{
struct Step : public MakeStep
{
Step(ProjectExplorer::BuildStepList *bsl) : MakeStep(bsl)
{
if (bsl->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN) {
setBuildTarget("clean", true);
setClean(true);
} else {
setBuildTarget("all", true);
}
}
};
registerStep<Step>(MAKE_STEP_ID);
registerStep<MakeStep>(MAKE_STEP_ID);
setDisplayName(ProjectExplorer::MakeStep::defaultDisplayName());
setSupportedProjectType(AUTOTOOLS_PROJECT_ID);
}
// MakeStep
MakeStep::MakeStep(ProjectExplorer::BuildStepList *bsl, const QString &buildTarget)
: ProjectExplorer::MakeStep(bsl, MAKE_STEP_ID, buildTarget, {"all", "clean"})
MakeStep::MakeStep(ProjectExplorer::BuildStepList *bsl)
: ProjectExplorer::MakeStep(bsl, MAKE_STEP_ID, QString(), {"all", "clean"})
{
if (bsl->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN) {
setBuildTarget("clean", true);
setClean(true);
} else {
setBuildTarget("all", true);
}
}