summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/projectexplorer/msvctoolchain.cpp18
-rw-r--r--src/plugins/projectexplorer/msvctoolchain.h2
2 files changed, 11 insertions, 9 deletions
diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp
index f441633741..3467df0af1 100644
--- a/src/plugins/projectexplorer/msvctoolchain.cpp
+++ b/src/plugins/projectexplorer/msvctoolchain.cpp
@@ -1125,13 +1125,15 @@ ToolChain::BuiltInHeaderPathsRunner MsvcToolChain::createBuiltInHeaderPathsRunne
return [this, fullEnv](const QStringList &, const QString &, const QString &) {
QMutexLocker locker(&m_headerPathsMutex);
- if (m_headerPaths.isEmpty()) {
- m_headerPaths = transform<QVector>(fullEnv.pathListValue("INCLUDE"),
- [](const FilePath &p) {
- return HeaderPath(p.toString(), HeaderPathType::BuiltIn);
- });
- }
- return m_headerPaths;
+ const auto envList = fullEnv.toStringList();
+ const auto it = m_headerPathsPerEnv.constFind(envList);
+ if (it != m_headerPathsPerEnv.cend())
+ return *it;
+ const auto mapper = [](const FilePath &p) { // TODO: Define functions for this.
+ return HeaderPath(p.toString(), HeaderPathType::BuiltIn);
+ };
+ return *m_headerPathsPerEnv.insert(envList,
+ transform<QVector>(fullEnv.pathListValue("INCLUDE"), mapper));
};
}
@@ -1787,7 +1789,7 @@ ClangClToolChain::BuiltInHeaderPathsRunner ClangClToolChain::createBuiltInHeader
{
{
QMutexLocker locker(&m_headerPathsMutex);
- m_headerPaths.clear();
+ m_headerPathsPerEnv.clear();
}
return MsvcToolChain::createBuiltInHeaderPathsRunner(env);
diff --git a/src/plugins/projectexplorer/msvctoolchain.h b/src/plugins/projectexplorer/msvctoolchain.h
index a13afe753d..2e42a163da 100644
--- a/src/plugins/projectexplorer/msvctoolchain.h
+++ b/src/plugins/projectexplorer/msvctoolchain.h
@@ -140,7 +140,7 @@ protected:
protected:
mutable QMutex m_headerPathsMutex;
- mutable HeaderPaths m_headerPaths;
+ mutable QHash<QStringList, HeaderPaths> m_headerPathsPerEnv;
private:
void updateEnvironmentModifications(Utils::EnvironmentItems modifications);