aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangpchmanager
diff options
context:
space:
mode:
authorIvan Donchevskii <ivan.donchevskii@qt.io>2019-02-15 16:15:01 +0100
committerIvan Donchevskii <ivan.donchevskii@qt.io>2019-02-19 07:34:19 +0000
commit29492ecf2494d875e3e2fa4951326aed275a3033 (patch)
tree99ab917485dc2201dcd9ceb251c1c08fe48f85e9 /src/plugins/clangpchmanager
parentdcf763c7ee380b68f8c20e5160493814142c9eac (diff)
ClangPchManager: Do not build pch and index inactive project parts
Some project parts should not be built as well as some files can be inactive inside project part. We should not try to build pch-s or index them. Change-Id: I8e62365b817a424ae38a0df94b6703820a4cde9d Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Diffstat (limited to 'src/plugins/clangpchmanager')
-rw-r--r--src/plugins/clangpchmanager/projectupdater.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/plugins/clangpchmanager/projectupdater.cpp b/src/plugins/clangpchmanager/projectupdater.cpp
index 28127fc39d..4e5cf95017 100644
--- a/src/plugins/clangpchmanager/projectupdater.cpp
+++ b/src/plugins/clangpchmanager/projectupdater.cpp
@@ -143,8 +143,10 @@ HeaderAndSources ProjectUpdater::headerAndSourcesFromProjectPart(
HeaderAndSources headerAndSources;
headerAndSources.reserve(std::size_t(projectPart->files.size()) * 3 / 2);
- for (const CppTools::ProjectFile &projectFile : projectPart->files)
- addToHeaderAndSources(headerAndSources, projectFile);
+ for (const CppTools::ProjectFile &projectFile : projectPart->files) {
+ if (projectFile.active)
+ addToHeaderAndSources(headerAndSources, projectFile);
+ }
std::sort(headerAndSources.sources.begin(), headerAndSources.sources.end());
std::sort(headerAndSources.headers.begin(), headerAndSources.headers.end());
@@ -297,6 +299,13 @@ ClangBackEnd::ProjectPartContainers ProjectUpdater::toProjectPartContainers(
std::vector<ClangBackEnd::ProjectPartContainer> projectPartContainers;
projectPartContainers.reserve(projectParts.size());
+ projectParts.erase(std::remove_if(projectParts.begin(),
+ projectParts.end(),
+ [](const CppTools::ProjectPart *projectPart) {
+ return !projectPart->selectedForBuilding;
+ }),
+ projectParts.end());
+
std::transform(projectParts.begin(),
projectParts.end(),
std::back_inserter(projectPartContainers),