C++: split defines into project-defined and toolchain-defined.

So we can ignore possibly problematic toolchain-defines, while can still
unconditionally apply project-defines.

Change-Id: I7cb96f35a963d080011fe888ef71bfc098dd33ef
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Erik Verbruggen
2013-11-27 15:17:51 +01:00
parent 18313bdb33
commit ea1a92484a
10 changed files with 45 additions and 34 deletions

View File

@@ -161,13 +161,7 @@ void ProjectPart::evaluateToolchain(const ToolChain *tc,
else
includePaths << header.path();
const QByteArray macros = tc->predefinedMacros(cxxflags);
if (!macros.isEmpty()) {
if (!defines.isEmpty())
defines += '\n';
defines += macros;
defines += '\n';
}
toolchainDefines = tc->predefinedMacros(cxxflags);
}
static CppModelManagerInterface *g_instance = 0;
@@ -235,5 +229,6 @@ void CppModelManagerInterface::ProjectInfo::appendProjectPart(const ProjectPart:
// Update defines
if (!m_defines.isEmpty())
m_defines.append('\n');
m_defines.append(part->defines);
m_defines.append(part->toolchainDefines);
m_defines.append(part->projectDefines);
}