From 214968a80b803989d32cc559aa9e5e0881f2fbf6 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 22 Sep 2021 16:44:29 +0200 Subject: [PATCH] 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 --- src/plugins/genericprojectmanager/genericproject.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index 8dd5c51f7e0..016cbfaaa14 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -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);