forked from qt-creator/qt-creator
CppTools: Fix include/framework search order
Task-number: QTCREATORBUG-11599 Change-Id: Ie0bd25e0d6376b5e2c0e251e64aad8dfb773e76e Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
This commit is contained in:
@@ -291,25 +291,19 @@ QString CppSourceProcessor::resolveFile_helper(const QString &fileName,
|
|||||||
ProjectPartHeaderPaths::Iterator headerPathsIt)
|
ProjectPartHeaderPaths::Iterator headerPathsIt)
|
||||||
{
|
{
|
||||||
auto headerPathsEnd = m_headerPaths.end();
|
auto headerPathsEnd = m_headerPaths.end();
|
||||||
for (; headerPathsIt != headerPathsEnd; ++headerPathsIt) {
|
|
||||||
if (headerPathsIt->isFrameworkPath())
|
|
||||||
continue;
|
|
||||||
const QString path = headerPathsIt->path + fileName;
|
|
||||||
if (m_workingCopy.contains(path) || checkFile(path))
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
const int index = fileName.indexOf(QLatin1Char('/'));
|
const int index = fileName.indexOf(QLatin1Char('/'));
|
||||||
if (index != -1) {
|
for (; headerPathsIt != headerPathsEnd; ++headerPathsIt) {
|
||||||
const QString frameworkName = fileName.left(index);
|
if (headerPathsIt->isValid()) {
|
||||||
const QString name = frameworkName + QLatin1String(".framework/Headers/")
|
QString path;
|
||||||
+ fileName.mid(index + 1);
|
if (headerPathsIt->isFrameworkPath()) {
|
||||||
|
if (index == -1)
|
||||||
foreach (const ProjectPartHeaderPath &headerPath, m_headerPaths) {
|
continue;
|
||||||
if (!headerPath.isFrameworkPath())
|
path = headerPathsIt->path + fileName.left(index)
|
||||||
continue;
|
+ QLatin1String(".framework/Headers/") + fileName.mid(index + 1);
|
||||||
const QString path = headerPath.path + name;
|
} else {
|
||||||
if (checkFile(path))
|
path = headerPathsIt->path + fileName;
|
||||||
|
}
|
||||||
|
if (m_workingCopy.contains(path) || checkFile(path))
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user