aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cmakeprojectmanager/builddirmanager.h
diff options
context:
space:
mode:
authorhjk <[email protected]>2019-10-25 09:55:32 +0200
committerhjk <[email protected]>2019-11-19 11:05:52 +0000
commit27586827238ca9079860e77a7b23ae20d163143e (patch)
tree2197dc7f97a4a70524381071888336558dc0b4a3 /src/plugins/cmakeprojectmanager/builddirmanager.h
parent9073c46c9c431ec0e83987a5781163ca7b1f7ea7 (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/cmakeprojectmanager/builddirmanager.h')
-rw-r--r--src/plugins/cmakeprojectmanager/builddirmanager.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/plugins/cmakeprojectmanager/builddirmanager.h b/src/plugins/cmakeprojectmanager/builddirmanager.h
index d3537104cc7..2be437c31b0 100644
--- a/src/plugins/cmakeprojectmanager/builddirmanager.h
+++ b/src/plugins/cmakeprojectmanager/builddirmanager.h
@@ -27,7 +27,6 @@
#include "builddirparameters.h"
#include "builddirreader.h"
-#include "cmakebuildsystem.h"
#include "cmakebuildtarget.h"
#include "cmakeconfigitem.h"
@@ -46,14 +45,11 @@
namespace ProjectExplorer { class FileNode; }
namespace CMakeProjectManager {
-
-class CMakeProject;
-class CMakeTool;
-
namespace Internal {
-class CMakeProjectNode;
class CMakeBuildConfiguration;
+class CMakeBuildSystem;
+class CMakeProjectNode;
class BuildDirManager : public QObject
{
@@ -71,7 +67,7 @@ public:
static QString flagsString(int reparseFlags);
- BuildDirManager(CMakeProject *project);
+ explicit BuildDirManager(CMakeBuildSystem *buildSystem);
~BuildDirManager() final;
bool isParsing() const;
@@ -81,8 +77,7 @@ public:
void setParametersAndRequestParse(const BuildDirParameters &parameters,
const int reparseOptions);
// nullptr if the BC is not active anymore!
- CMakeBuildConfiguration *buildConfiguration() const;
- CMakeProject *project() const {return m_project; }
+ CMakeBuildSystem *buildSystem() const;
Utils::FilePath buildDirectory() const;
void clearCache();
@@ -133,7 +128,7 @@ private:
BuildDirParameters m_parameters;
int m_reparseParameters;
- CMakeProject *m_project = nullptr;
+ CMakeBuildSystem *m_buildSystem = nullptr;
mutable std::unordered_map<Utils::FilePath, std::unique_ptr<Utils::TemporaryDirectory>> m_buildDirToTempDir;
mutable std::unique_ptr<BuildDirReader> m_reader;
mutable bool m_isHandlingError = false;