CppTools: fix inclusion of "injected" defines.

Task-number: QTCREATORBUG-10280

Change-Id: Ibc6ffeedb97a31a35a2d1f00625506f844692e16
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Erik Verbruggen
2013-10-01 14:48:31 +02:00
committed by Nikolai Kosjar
parent 336644a70d
commit d57b405f29
4 changed files with 19 additions and 5 deletions

View File

@@ -153,15 +153,21 @@ void SnapshotUpdater::update(CppModelManager::WorkingCopy workingCopy)
preproc.setIncludePaths(m_includePaths);
preproc.setFrameworkPaths(m_frameworkPaths);
preproc.run(configurationFileName);
if (m_usePrecompiledHeaders)
if (m_usePrecompiledHeaders) {
foreach (const QString &precompiledHeader, m_precompiledHeaders)
preproc.run(precompiledHeader);
}
if (!m_editorDefines.isEmpty())
preproc.run(editorDefinesFileName);
preproc.run(m_fileInEditor);
m_snapshot = preproc.snapshot();
m_snapshot = m_snapshot.simplified(document());
Snapshot newSnapshot = m_snapshot.simplified(document());
for (Snapshot::const_iterator i = m_snapshot.begin(), ei = m_snapshot.end(); i != ei; ++i) {
if (Client::isInjectedFile(i.key()))
newSnapshot.insert(i.value());
}
m_snapshot = newSnapshot;
m_deps.build(m_snapshot);
foreach (Document::Ptr doc, m_snapshot) {