QmakePM: Only consider the first make step for subproject builds

When the user requests to build a sub-project or a single file of a
qmake project, we simply run the normal steps from the build
configuration, and the make steps modify themselves to run in the
respective subdirectory and/or with specific targets. Normally, there is
only one such make step. If the user added more make steps, it is very
likely that these only make sense for a top-level build, so we simply
make them no-ops when building a sub-project or single file.

Fixes: QTCREATORBUG-15794
Change-Id: I960cf60dba5e5d6b6e839d35e34650427f659110
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Christian Kandeler
2019-04-30 15:05:37 +02:00
parent 78d1e2d772
commit 66237a6e04
2 changed files with 6 additions and 1 deletions

View File

@@ -83,6 +83,10 @@ bool QmakeMakeStep::init()
return false;
}
// Ignore all but the first make step for a non-top-level build. See QTCREATORBUG-15794.
m_ignoredNonTopLevelBuild = (bc->fileNodeBuild() || bc->subNodeBuild())
&& static_cast<BuildStepList *>(parent())->firstOfType<QmakeMakeStep>() != this;
ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
@@ -177,7 +181,7 @@ bool QmakeMakeStep::init()
void QmakeMakeStep::doRun()
{
if (m_scriptTarget) {
if (m_scriptTarget || m_ignoredNonTopLevelBuild) {
emit finished(true);
return;
}

View File

@@ -62,6 +62,7 @@ private:
bool m_scriptTarget = false;
QString m_makeFileToCheck;
bool m_unalignedBuildDir;
bool m_ignoredNonTopLevelBuild = false;
};
} // QmakeProjectManager