diff --git a/src/plugins/cmakeprojectmanager/builddirmanager.cpp b/src/plugins/cmakeprojectmanager/builddirmanager.cpp index 71fccc5df8c..2a28093c1fc 100644 --- a/src/plugins/cmakeprojectmanager/builddirmanager.cpp +++ b/src/plugins/cmakeprojectmanager/builddirmanager.cpp @@ -125,13 +125,14 @@ void BuildDirManager::updateReaderData() m_reader->setParameters(p); } -void BuildDirManager::parseOnceReaderReady(bool force) +void BuildDirManager::parseOnceReaderReady(bool force, bool checkForChanges) { TaskHub::clearTasks(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM); m_buildTargets.clear(); m_cmakeCache.clear(); - checkConfiguration(); + if (checkForChanges) + checkConfiguration(); m_reader->stop(); m_reader->parse(force); } @@ -223,6 +224,16 @@ void BuildDirManager::becameDirty() } void BuildDirManager::forceReparse() +{ + forceReparseImpl(true); +} + +void BuildDirManager::forceReparseWithoutCheckingForChanges() +{ + forceReparseImpl(false); +} + +void BuildDirManager::forceReparseImpl(bool checkForChanges) { QTC_ASSERT(!m_isHandlingError, return); @@ -233,7 +244,7 @@ void BuildDirManager::forceReparse() QTC_ASSERT(tool, return); m_reader.reset(); // Force reparse by forcing in a new reader - updateReaderType([this]() { parseOnceReaderReady(true); }); + updateReaderType([this, checkForChanges]() { parseOnceReaderReady(true, checkForChanges); }); } void BuildDirManager::resetData() diff --git a/src/plugins/cmakeprojectmanager/builddirmanager.h b/src/plugins/cmakeprojectmanager/builddirmanager.h index f0381970ab8..489ca67ff7f 100644 --- a/src/plugins/cmakeprojectmanager/builddirmanager.h +++ b/src/plugins/cmakeprojectmanager/builddirmanager.h @@ -64,6 +64,7 @@ public: void clearCache(); void forceReparse(); + void forceReparseWithoutCheckingForChanges(); void maybeForceReparse(); // Only reparse if the configuration has changed... void resetData(); bool updateCMakeStateBeforeBuild(); @@ -96,7 +97,8 @@ private: void updateReaderType(std::function todo); void updateReaderData(); - void parseOnceReaderReady(bool force); + void forceReparseImpl(bool checkForChanges); + void parseOnceReaderReady(bool force, bool checkForChanges = true); void maybeForceReparseOnceReaderReady(); void parse(); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index b4113c53fdc..ef828919faa 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -346,7 +346,7 @@ void CMakeBuildConfiguration::setCurrentCMakeConfiguration(const QListforceReparse(); + m_buildDirManager->forceReparseWithoutCheckingForChanges(); } void CMakeBuildConfiguration::clearError(ForceEnabledChanged fec)