diff --git a/src/plugins/autotoolsprojectmanager/autogenstep.cpp b/src/plugins/autotoolsprojectmanager/autogenstep.cpp index 090389716de..a6121de9276 100644 --- a/src/plugins/autotoolsprojectmanager/autogenstep.cpp +++ b/src/plugins/autotoolsprojectmanager/autogenstep.cpp @@ -14,6 +14,7 @@ #include #include +#include #include @@ -71,27 +72,31 @@ AutogenStep::AutogenStep(BuildStepList *bsl, Id id) : AbstractProcessStep(bsl, i void AutogenStep::doRun() { - // Check whether we need to run autogen.sh - const FilePath projectDir = project()->projectDirectory(); - const FilePath configure = projectDir / "configure"; - const FilePath configureAc = projectDir / "configure.ac"; - const FilePath makefileAm = projectDir / "Makefile.am"; + using namespace Tasking; - if (!configure.exists() - || configure.lastModified() < configureAc.lastModified() - || configure.lastModified() < makefileAm.lastModified()) { - m_runAutogen = true; - } + const auto onSetup = [this] { + // Check whether we need to run autogen.sh + const FilePath projectDir = project()->projectDirectory(); + const FilePath configure = projectDir / "configure"; + const FilePath configureAc = projectDir / "configure.ac"; + const FilePath makefileAm = projectDir / "Makefile.am"; - if (!m_runAutogen) { - emit addOutput(Tr::tr("Configuration unchanged, skipping autogen step."), - OutputFormat::NormalMessage); - emit finished(true); - return; - } + if (!configure.exists() + || configure.lastModified() < configureAc.lastModified() + || configure.lastModified() < makefileAm.lastModified()) { + m_runAutogen = true; + } - m_runAutogen = false; - AbstractProcessStep::doRun(); + if (!m_runAutogen) { + emit addOutput(Tr::tr("Configuration unchanged, skipping autogen step."), + OutputFormat::NormalMessage); + return SetupResult::StopWithDone; + } + return SetupResult::Continue; + }; + const auto onDone = [this] { m_runAutogen = false; }; + + runTaskTree({onGroupSetup(onSetup), onGroupDone(onDone), defaultProcessTask()}); } // AutogenStepFactory