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:
Christian Kandeler
2021-09-22 16:44:29 +02:00
parent 49569574de
commit 214968a80b

View File

@@ -431,13 +431,14 @@ void GenericBuildSystem::parse(RefreshOptions options)
if (options & Configuration) { if (options & Configuration) {
m_rawProjectIncludePaths = readLines(m_includesFileName); m_rawProjectIncludePaths = readLines(m_includesFileName);
QStringList normalPaths; Utils::FilePaths normalPaths;
QStringList frameworkPaths; Utils::FilePaths frameworkPaths;
const auto baseDir = Utils::FilePath::fromString(m_includesFileName).parentDir();
for (const QString &rawPath : qAsConst(m_rawProjectIncludePaths)) { for (const QString &rawPath : qAsConst(m_rawProjectIncludePaths)) {
if (rawPath.startsWith("-F")) if (rawPath.startsWith("-F"))
frameworkPaths << rawPath.mid(2); frameworkPaths << baseDir.resolvePath(rawPath.mid(2));
else else
normalPaths << rawPath; normalPaths << baseDir.resolvePath(rawPath);
} }
m_projectIncludePaths = toUserHeaderPaths(normalPaths); m_projectIncludePaths = toUserHeaderPaths(normalPaths);
m_projectIncludePaths << toFrameworkHeaderPaths(frameworkPaths); m_projectIncludePaths << toFrameworkHeaderPaths(frameworkPaths);