forked from qt-creator/qt-creator
GenericProject: Pass resolved include paths to code model
Apparently, we used to rely on relative paths being resolved elsewhere, but we shouldn't. Fixes: QTCREATORBUG-26304 Change-Id: Ia52b728909abc87c1225f8e935f4548a32ca9b63 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -431,13 +431,14 @@ void GenericBuildSystem::parse(RefreshOptions options)
|
||||
|
||||
if (options & Configuration) {
|
||||
m_rawProjectIncludePaths = readLines(m_includesFileName);
|
||||
QStringList normalPaths;
|
||||
QStringList frameworkPaths;
|
||||
Utils::FilePaths normalPaths;
|
||||
Utils::FilePaths frameworkPaths;
|
||||
const auto baseDir = Utils::FilePath::fromString(m_includesFileName).parentDir();
|
||||
for (const QString &rawPath : qAsConst(m_rawProjectIncludePaths)) {
|
||||
if (rawPath.startsWith("-F"))
|
||||
frameworkPaths << rawPath.mid(2);
|
||||
frameworkPaths << baseDir.resolvePath(rawPath.mid(2));
|
||||
else
|
||||
normalPaths << rawPath;
|
||||
normalPaths << baseDir.resolvePath(rawPath);
|
||||
}
|
||||
m_projectIncludePaths = toUserHeaderPaths(normalPaths);
|
||||
m_projectIncludePaths << toFrameworkHeaderPaths(frameworkPaths);
|
||||
|
Reference in New Issue
Block a user