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;