Skip to content
Snippets Groups Projects
Commit c9e50605 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Get rid of extra (non Creator-friendly) include paths.

parent d1cb9fed
No related branches found
No related tags found
No related merge requests found
...@@ -190,7 +190,31 @@ void CppPreprocessor::setWorkingCopy(const CppTools::CppModelManagerInterface::W ...@@ -190,7 +190,31 @@ void CppPreprocessor::setWorkingCopy(const CppTools::CppModelManagerInterface::W
{ m_workingCopy = workingCopy; } { m_workingCopy = workingCopy; }
void CppPreprocessor::setIncludePaths(const QStringList &includePaths) void CppPreprocessor::setIncludePaths(const QStringList &includePaths)
{ m_includePaths = includePaths; } {
m_includePaths.clear();
for (int i = 0; i < includePaths.size(); ++i) {
const QString path = includePaths.at(i);
#ifdef Q_OS_DARWIN
if (i + 1 < includePaths.size() && path.endsWith(QLatin1String(".framework/Headers"))) {
const QFileInfo pathInfo(path);
const QFileInfo frameworkFileInfo(pathInfo.path());
const QString frameworkName = frameworkFileInfo.baseName();
const QFileInfo nextIncludePath = includePaths.at(i + 1);
if (nextIncludePath.fileName() == frameworkName) {
// We got a QtXXX.framework/Headers followed by $QTDIR/include/QtXXX.
// In this case we prefer to include files from $QTDIR/include/QtXXX.
continue;
}
}
m_includePaths.append(path);
#else
m_includePaths.append(path);
#endif
}
}
void CppPreprocessor::setFrameworkPaths(const QStringList &frameworkPaths) void CppPreprocessor::setFrameworkPaths(const QStringList &frameworkPaths)
{ m_frameworkPaths = frameworkPaths; } { m_frameworkPaths = frameworkPaths; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment