From d0a192064ea5e49d794117f14bb4311e0f204424 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 20 Apr 2022 11:29:18 +0200 Subject: [PATCH] GenericProject: Re-introduce variable resolving in include paths Variable expansion and relative path resolving were accidentally removed in 25ff15a1fb. Relative path resolving was re-added in 214968a80b, which is superseded here. Fixes: QTCREATORBUG-27401 Change-Id: Ida09e7b486765942c43acf55c4ef9c04eb3df12b Reviewed-by: Qt CI Bot Reviewed-by: Reviewed-by: Christian Stenger --- .../genericprojectmanager/genericproject.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index f9f5a7cd949..c6c4d0411b2 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -435,17 +435,22 @@ void GenericBuildSystem::parse(RefreshOptions options) if (options & Configuration) { m_rawProjectIncludePaths = readLines(m_includesFileName); - Utils::FilePaths normalPaths; - Utils::FilePaths frameworkPaths; + QStringList normalPaths; + QStringList frameworkPaths; const auto baseDir = Utils::FilePath::fromString(m_includesFileName).parentDir(); for (const QString &rawPath : qAsConst(m_rawProjectIncludePaths)) { if (rawPath.startsWith("-F")) - frameworkPaths << baseDir.resolvePath(rawPath.mid(2)); + frameworkPaths << rawPath.mid(2); else - normalPaths << baseDir.resolvePath(rawPath); + normalPaths << rawPath; } - m_projectIncludePaths = toUserHeaderPaths(normalPaths); - m_projectIncludePaths << toFrameworkHeaderPaths(frameworkPaths); + const auto expandedPaths = [this](const QStringList &paths) { + return Utils::transform(processEntries(paths), [](const auto &pair) { + return pair.first; + }); + }; + m_projectIncludePaths = toUserHeaderPaths(expandedPaths(normalPaths)); + m_projectIncludePaths << toFrameworkHeaderPaths(expandedPaths(frameworkPaths)); m_cxxflags = readFlags(m_cxxflagsFileName); m_cflags = readFlags(m_cflagsFileName); }