CppTools: Fix initial macro parsing for generic project

The extra macros in the config files are being read in
CppModelManager::internalDefinedMacros(), but they also affect the language
features in ProjectPart::updateLanguageFeatures().

Task-number: QTCREATORBUG-1478
Change-Id: Ic197b0b7d4cc6e6a74637da0c710b0630daae25c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Orgad Shaneh
2017-11-23 17:21:35 +02:00
committed by Orgad Shaneh
parent 283069f4af
commit ec86bf8ca6
2 changed files with 2 additions and 2 deletions

View File

@@ -481,8 +481,6 @@ ProjectExplorer::Macros CppModelManager::internalDefinedMacros() const
for (const ProjectPart::Ptr &part : pinfo.projectParts()) { for (const ProjectPart::Ptr &part : pinfo.projectParts()) {
addUnique(part->toolChainMacros, macros, alreadyIn); addUnique(part->toolChainMacros, macros, alreadyIn);
addUnique(part->projectMacros, macros, alreadyIn); addUnique(part->projectMacros, macros, alreadyIn);
if (!part->projectConfigFile.isEmpty())
macros += ProjectExplorer::Macro::toMacros(ProjectPart::readProjectConfigFile(part));
} }
} }
return macros; return macros;

View File

@@ -190,6 +190,8 @@ static ProjectPart::Ptr projectPartFromRawProjectPart(const RawProjectPart &rawP
part->buildTargetType = rawProjectPart.buildTargetType; part->buildTargetType = rawProjectPart.buildTargetType;
part->qtVersion = rawProjectPart.qtVersion; part->qtVersion = rawProjectPart.qtVersion;
part->projectMacros = rawProjectPart.projectMacros; part->projectMacros = rawProjectPart.projectMacros;
if (!part->projectConfigFile.isEmpty())
part->projectMacros += ProjectExplorer::Macro::toMacros(ProjectPart::readProjectConfigFile(part));
part->headerPaths = rawProjectPart.headerPaths; part->headerPaths = rawProjectPart.headerPaths;
part->precompiledHeaders = rawProjectPart.precompiledHeaders; part->precompiledHeaders = rawProjectPart.precompiledHeaders;
part->selectedForBuilding = rawProjectPart.selectedForBuilding; part->selectedForBuilding = rawProjectPart.selectedForBuilding;