diff --git a/src/plugins/python/pythonbuildsystem.cpp b/src/plugins/python/pythonbuildsystem.cpp index e46e33497bc..717395e6aa4 100644 --- a/src/plugins/python/pythonbuildsystem.cpp +++ b/src/plugins/python/pythonbuildsystem.cpp @@ -129,6 +129,16 @@ PythonBuildSystem::PythonBuildSystem(PythonBuildConfiguration *buildConfig) requestParse(); } +PythonBuildSystem::PythonBuildSystem(ProjectExplorer::Target *target) + : BuildSystem(target) +{ + connect(project(), + &Project::projectFileIsDirty, + this, + &PythonBuildSystem::requestDelayedParse); + requestParse(); +} + bool PythonBuildSystem::supportsAction(Node *context, ProjectAction action, const Node *node) const { if (node->asFileNode()) { diff --git a/src/plugins/python/pythonbuildsystem.h b/src/plugins/python/pythonbuildsystem.h index 9729ac3fe50..adf69640790 100644 --- a/src/plugins/python/pythonbuildsystem.h +++ b/src/plugins/python/pythonbuildsystem.h @@ -13,6 +13,7 @@ class PythonBuildSystem : public ProjectExplorer::BuildSystem { public: explicit PythonBuildSystem(PythonBuildConfiguration *buildConfig); + explicit PythonBuildSystem(ProjectExplorer::Target *target); bool supportsAction(ProjectExplorer::Node *context, ProjectExplorer::ProjectAction action, diff --git a/src/plugins/python/pythonproject.cpp b/src/plugins/python/pythonproject.cpp index 316e35d2620..02eafcbcff3 100644 --- a/src/plugins/python/pythonproject.cpp +++ b/src/plugins/python/pythonproject.cpp @@ -23,6 +23,8 @@ PythonProject::PythonProject(const FilePath &fileName) setId(PythonProjectId); setProjectLanguages(Context(ProjectExplorer::Constants::PYTHON_LANGUAGE_ID)); setDisplayName(fileName.completeBaseName()); + + setBuildSystemCreator([](Target *t) { return new PythonBuildSystem(t); }); } Project::RestoreResult PythonProject::fromMap(const Store &map, QString *errorMessage)