QbsProjectManager: Only hold one build graph per project

Keeping the build graphs of all enabled targets in memory does not
scale.

Task-number: QTCREATORBUG-20622
Change-Id: Iab711e7e789db51a5ee13aa9bf3c9fbb2e08aa89
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2018-08-30 10:53:50 +02:00
parent 3d9974db95
commit 39d7aa7f70

View File

@@ -546,11 +546,19 @@ void QbsProject::handleRuleExecutionDone()
void QbsProject::changeActiveTarget(Target *t)
{
if (t) {
m_qbsProject = m_qbsProjects.value(t);
if (t->isActive())
delayParsing();
bool targetFound = false;
for (auto it = m_qbsProjects.begin(); it != m_qbsProjects.end(); ++it) {
qbs::Project &qbsProjectForTarget = it.value();
if (it.key() == t) {
m_qbsProject = qbsProjectForTarget;
targetFound = true;
} else if (qbsProjectForTarget.isValid() && !BuildManager::isBuilding(it.key())) {
qbsProjectForTarget = qbs::Project();
}
}
QTC_ASSERT(targetFound || !t, m_qbsProject = qbs::Project());
if (t && t->isActive())
delayParsing();
}
void QbsProject::startParsing()