forked from qt-creator/qt-creator
Fix updating the codemodel for cmake on switching buildconfigurations
That is we update all files with the new include and defines if we are switching toolchains.
This commit is contained in:
@@ -228,12 +228,18 @@ bool CMakeProject::parseCMakeLists()
|
|||||||
CppTools::CppModelManagerInterface *modelmanager = ExtensionSystem::PluginManager::instance()->getObject<CppTools::CppModelManagerInterface>();
|
CppTools::CppModelManagerInterface *modelmanager = ExtensionSystem::PluginManager::instance()->getObject<CppTools::CppModelManagerInterface>();
|
||||||
if (modelmanager) {
|
if (modelmanager) {
|
||||||
CppTools::CppModelManagerInterface::ProjectInfo pinfo = modelmanager->projectInfo(this);
|
CppTools::CppModelManagerInterface::ProjectInfo pinfo = modelmanager->projectInfo(this);
|
||||||
|
if (pinfo.includePaths != allIncludePaths
|
||||||
|
|| pinfo.sourceFiles != m_files
|
||||||
|
|| pinfo.defines != m_toolChain->predefinedMacros()
|
||||||
|
|| pinfo.frameworkPaths != allFrameworkPaths) {
|
||||||
pinfo.includePaths = allIncludePaths;
|
pinfo.includePaths = allIncludePaths;
|
||||||
// TODO we only want C++ files, not all other stuff that might be in the project
|
// TODO we only want C++ files, not all other stuff that might be in the project
|
||||||
pinfo.sourceFiles = m_files;
|
pinfo.sourceFiles = m_files;
|
||||||
pinfo.defines = m_toolChain->predefinedMacros(); // TODO this is to simplistic
|
pinfo.defines = m_toolChain->predefinedMacros(); // TODO this is to simplistic
|
||||||
pinfo.frameworkPaths = allFrameworkPaths;
|
pinfo.frameworkPaths = allFrameworkPaths;
|
||||||
modelmanager->updateProjectInfo(pinfo);
|
modelmanager->updateProjectInfo(pinfo);
|
||||||
|
modelmanager->updateSourceFiles(pinfo.sourceFiles);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create run configurations for m_targets
|
// Create run configurations for m_targets
|
||||||
|
|||||||
Reference in New Issue
Block a user