diff options
author | hjk <[email protected]> | 2019-10-25 09:55:32 +0200 |
---|---|---|
committer | hjk <[email protected]> | 2019-11-19 11:05:52 +0000 |
commit | 27586827238ca9079860e77a7b23ae20d163143e (patch) | |
tree | 2197dc7f97a4a70524381071888336558dc0b4a3 /src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp | |
parent | 9073c46c9c431ec0e83987a5781163ca7b1f7ea7 (diff) |
ProjectExplorer: Move BuildSystem owership to BuildConfiguration
... or Target.
This patch moves build system from conceptually "one per project"
to "one per target (i.e. per project-and-kit)" or "per
BuildConfigurations" for targets where the builds differ
significantly.
Building requires usually items from the kit (Qt version, compiler,
...) so a target-agnostic build is practically almost always wrong.
Moving the build system to the target also has the potential
to solve issues caused by switching targets while parsing, that
used Project::activeTarget() regularly, with potentially different
results before and after the switch.
This patch might create performance/size regressions when several
targets are set up per project as the build system implementation's
internal data are duplicated in this case.
The idea is to fix that by sharing per-project pieces again in
the project implementation once these problems occur.
Change-Id: I87f640ce418b93175b5029124eaa55f3b8721dca
Reviewed-by: Christian Stenger <[email protected]>
Reviewed-by: Christian Kandeler <[email protected]>
Diffstat (limited to 'src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp')
-rw-r--r-- | src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp b/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp index f7bbde2a138..cc6e7e54db8 100644 --- a/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp +++ b/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp @@ -203,19 +203,19 @@ QStringList unreferencedBuildSystemFiles(const qbs::Project &p) } // namespace -std::unique_ptr<QbsRootProjectNode> QbsNodeTreeBuilder::buildTree(QbsProject *project) +std::unique_ptr<QbsRootProjectNode> QbsNodeTreeBuilder::buildTree(QbsBuildSystem *buildSystem) { - if (!project->qbsProjectData().isValid()) + if (!buildSystem->qbsProjectData().isValid()) return {}; - auto root = std::make_unique<QbsRootProjectNode>(project); - setupProjectNode(root.get(), project->qbsProjectData(), project->qbsProject()); + auto root = std::make_unique<QbsRootProjectNode>(buildSystem->project()); + setupProjectNode(root.get(), buildSystem->qbsProjectData(), buildSystem->qbsProject()); - auto buildSystemFiles = std::make_unique<FolderNode>(project->projectDirectory()); + auto buildSystemFiles = std::make_unique<FolderNode>(buildSystem->projectDirectory()); buildSystemFiles->setDisplayName(QCoreApplication::translate("QbsRootProjectNode", "Qbs files")); - const FilePath base = project->projectDirectory(); - const QStringList files = unreferencedBuildSystemFiles(project->qbsProject()); + const FilePath base = buildSystem->projectDirectory(); + const QStringList files = unreferencedBuildSystemFiles(buildSystem->qbsProject()); for (const QString &f : files) { const FilePath filePath = FilePath::fromString(f); if (filePath.isChildOf(base)) |