diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildsystem.cpp b/src/plugins/autotoolsprojectmanager/autotoolsbuildsystem.cpp index a916989e9a3..e913ec47e08 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildsystem.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildsystem.cpp @@ -12,6 +12,8 @@ #include +#include + #include #include @@ -21,6 +23,33 @@ using namespace Utils; namespace AutotoolsProjectManager::Internal { +class AutotoolsBuildSystem final : public BuildSystem +{ +public: + explicit AutotoolsBuildSystem(Target *target); + ~AutotoolsBuildSystem() final; + +private: + void triggerParsing() final; + QString name() const final { return QLatin1String("autotools"); } + + /** + * Is invoked when the makefile parsing by m_makefileParserThread has + * been finished. Adds all sources and files into the project tree and + * takes care listen to file changes for Makefile.am and configure.ac + * files. + */ + void makefileParsingFinished(const MakefileParserOutputData &outputData); + + /// Return value for AutotoolsProject::files() + QStringList m_files; + + /// Responsible for parsing the makefiles asynchronously in a thread + Tasking::TaskTreeRunner m_parserRunner; + + std::unique_ptr m_cppCodeModelUpdater; +}; + AutotoolsBuildSystem::AutotoolsBuildSystem(Target *target) : BuildSystem(target) , m_cppCodeModelUpdater(ProjectUpdaterFactory::createCppProjectUpdater()) @@ -147,6 +176,12 @@ void AutotoolsBuildSystem::makefileParsingFinished(const MakefileParserOutputDat m_cppCodeModelUpdater->update({project(), kitInfo, activeParseEnvironment(), {rpp}}); - emitBuildSystemUpdated();} + emitBuildSystemUpdated(); +} + +BuildSystem *createAutotoolsBuildSystem(Target *target) +{ + return new AutotoolsBuildSystem(target); +} } // AutotoolsProjectManager::Internal diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildsystem.h b/src/plugins/autotoolsprojectmanager/autotoolsbuildsystem.h index cb286690f00..25cd6e829e3 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildsystem.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildsystem.h @@ -5,39 +5,8 @@ #include -#include - -namespace ProjectExplorer { class ProjectUpdater; } - namespace AutotoolsProjectManager::Internal { -class MakefileParserOutputData; - -class AutotoolsBuildSystem final : public ProjectExplorer::BuildSystem -{ -public: - explicit AutotoolsBuildSystem(ProjectExplorer::Target *target); - ~AutotoolsBuildSystem() final; - -private: - void triggerParsing() final; - QString name() const final { return QLatin1String("autotools"); } - - /** - * Is invoked when the makefile parsing by m_makefileParserThread has - * been finished. Adds all sources and files into the project tree and - * takes care listen to file changes for Makefile.am and configure.ac - * files. - */ - void makefileParsingFinished(const MakefileParserOutputData &outputData); - - /// Return value for AutotoolsProject::files() - QStringList m_files; - - /// Responsible for parsing the makefiles asynchronously in a thread - Tasking::TaskTreeRunner m_parserRunner; - - std::unique_ptr m_cppCodeModelUpdater; -}; +ProjectExplorer::BuildSystem *createAutotoolsBuildSystem(ProjectExplorer::Target *target); } // AutotoolsProjectManager::Internal diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp b/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp index 12d645bc8a5..212f0cdb666 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include @@ -41,10 +40,8 @@ public: setId(Constants::AUTOTOOLS_PROJECT_ID); setProjectLanguages(Core::Context(ProjectExplorer::Constants::CXX_LANGUAGE_ID)); setDisplayName(projectDirectory().fileName()); - setHasMakeInstallEquivalent(true); - - setBuildSystemCreator(); + setBuildSystemCreator(&createAutotoolsBuildSystem); } }; diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 6e8dbb8effd..b56d6ba0a9b 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -1032,7 +1032,7 @@ Task Project::createProjectTask(Task::TaskType type, const QString &description) return Task(type, description, FilePath(), -1, Id()); } -void Project::setBuildSystemCreatorImpl(const std::function &creator) +void Project::setBuildSystemCreator(const std::function &creator) { d->m_buildSystemCreator = creator; } diff --git a/src/plugins/projectexplorer/project.h b/src/plugins/projectexplorer/project.h index af334d49a2e..9c60aa3ed6c 100644 --- a/src/plugins/projectexplorer/project.h +++ b/src/plugins/projectexplorer/project.h @@ -234,11 +234,11 @@ protected: const QString &description); template void setBuildSystemCreator() { - setBuildSystemCreatorImpl([](Target *t) { return new BuildSystemImpl(t); }); + setBuildSystemCreator([](Target *t) { return new BuildSystemImpl(t); }); } -private: - void setBuildSystemCreatorImpl(const std::function &creator); + void setBuildSystemCreator(const std::function &creator); +private: void addTarget(std::unique_ptr &&target); void addProjectLanguage(Utils::Id id);