Make the project managers tell the code model about include paths

... from the environment.

Fixes: QTCREATORBUG-17985
Change-Id: I9b54e550121cfcc0684a6e173337d59d235c6107
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Christian Kandeler
2019-07-05 16:58:07 +02:00
parent 6e1595c1b3
commit f7520b7d99
35 changed files with 168 additions and 113 deletions

View File

@@ -35,7 +35,7 @@
namespace CppTools {
ToolChainInfo::ToolChainInfo(const ProjectExplorer::ToolChain *toolChain,
const QString &sysRootPath)
const QString &sysRootPath, const Utils::Environment &env)
{
if (toolChain) {
// Keep the following cheap/non-blocking for the ui thread...
@@ -49,20 +49,21 @@ ToolChainInfo::ToolChainInfo(const ProjectExplorer::ToolChain *toolChain,
// ...and save the potentially expensive operations for later so that
// they can be run from a worker thread.
this->sysRootPath = sysRootPath;
headerPathsRunner = toolChain->createBuiltInHeaderPathsRunner();
headerPathsRunner = toolChain->createBuiltInHeaderPathsRunner(env);
macroInspectionRunner = toolChain->createMacroInspectionRunner();
}
}
ProjectUpdateInfo::ProjectUpdateInfo(ProjectExplorer::Project *project,
const KitInfo &kitInfo,
const Utils::Environment &env,
const RawProjectParts &rawProjectParts)
: project(project)
, rawProjectParts(rawProjectParts)
, cToolChain(kitInfo.cToolChain)
, cxxToolChain(kitInfo.cxxToolChain)
, cToolChainInfo(ToolChainInfo(cToolChain, kitInfo.sysRootPath))
, cxxToolChainInfo(ToolChainInfo(cxxToolChain, kitInfo.sysRootPath))
, cToolChainInfo(ToolChainInfo(cToolChain, kitInfo.sysRootPath, env))
, cxxToolChainInfo(ToolChainInfo(cxxToolChain, kitInfo.sysRootPath, env))
{
}

View File

@@ -47,7 +47,7 @@ class ToolChainInfo
public:
ToolChainInfo() = default;
ToolChainInfo(const ProjectExplorer::ToolChain *toolChain,
const QString &sysRootPath);
const QString &sysRootPath, const Utils::Environment &env);
bool isValid() const { return type.isValid(); }
@@ -69,6 +69,7 @@ public:
ProjectUpdateInfo() = default;
ProjectUpdateInfo(ProjectExplorer::Project *project,
const KitInfo &kitInfo,
const Utils::Environment &env,
const RawProjectParts &rawProjectParts);
bool isValid() const { return project && !rawProjectParts.isEmpty(); }