aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangpchmanager
diff options
context:
space:
mode:
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 28127fc39d1..4e5cf950178 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),