ProjectExplorer: Use a functor for BuildSystem creation

... instead of creating the BuildSystem direct. This will help the
shift of BuildSystem owner ship as a Project will have potentially
multiple BuildSystem instances (one per BuildConfiguration), but
still be responsible for creating them with the Targets.

Change-Id: I2dd71c7687ed41af9e42c874b3f932ce704e7ee3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2019-10-23 08:47:05 +02:00
parent 5b815d22a3
commit 6a878c7293
16 changed files with 34 additions and 33 deletions

View File

@@ -122,7 +122,7 @@ private:
class GenericBuildSytem : public BuildSystem
{
public:
explicit GenericBuildSytem(GenericProject *project)
explicit GenericBuildSytem(Project *project)
: BuildSystem(project)
{}
@@ -176,7 +176,7 @@ GenericProject::GenericProject(const Utils::FilePath &fileName)
setId(Constants::GENERICPROJECT_ID);
setProjectLanguages(Context(ProjectExplorer::Constants::CXX_LANGUAGE_ID));
setDisplayName(fileName.toFileInfo().completeBaseName());
setBuildSystem(std::make_unique<GenericBuildSytem>(this));
setBuildSystemCreator([](Project *p) { return new GenericBuildSytem(p); });
QObject *projectUpdaterFactory = ExtensionSystem::PluginManager::getObjectByName(
"CppProjectUpdaterFactory");