forked from qt-creator/qt-creator
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:
@@ -546,12 +546,20 @@ 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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user