From ec86bf8ca61c3afff9922a0f7c4751bd68e31357 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 23 Nov 2017 17:21:35 +0200 Subject: [PATCH] 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 Reviewed-by: Nikolai Kosjar --- src/plugins/cpptools/cppmodelmanager.cpp | 2 -- src/plugins/cpptools/cppprojectinfogenerator.cpp | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index da453017822..4046a1bbd2a 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -481,8 +481,6 @@ ProjectExplorer::Macros CppModelManager::internalDefinedMacros() const for (const ProjectPart::Ptr &part : pinfo.projectParts()) { addUnique(part->toolChainMacros, macros, alreadyIn); addUnique(part->projectMacros, macros, alreadyIn); - if (!part->projectConfigFile.isEmpty()) - macros += ProjectExplorer::Macro::toMacros(ProjectPart::readProjectConfigFile(part)); } } return macros; diff --git a/src/plugins/cpptools/cppprojectinfogenerator.cpp b/src/plugins/cpptools/cppprojectinfogenerator.cpp index 2be82ea6b47..4a76052c666 100644 --- a/src/plugins/cpptools/cppprojectinfogenerator.cpp +++ b/src/plugins/cpptools/cppprojectinfogenerator.cpp @@ -190,6 +190,8 @@ static ProjectPart::Ptr projectPartFromRawProjectPart(const RawProjectPart &rawP part->buildTargetType = rawProjectPart.buildTargetType; part->qtVersion = rawProjectPart.qtVersion; part->projectMacros = rawProjectPart.projectMacros; + if (!part->projectConfigFile.isEmpty()) + part->projectMacros += ProjectExplorer::Macro::toMacros(ProjectPart::readProjectConfigFile(part)); part->headerPaths = rawProjectPart.headerPaths; part->precompiledHeaders = rawProjectPart.precompiledHeaders; part->selectedForBuilding = rawProjectPart.selectedForBuilding;