summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2021-03-29 19:04:46 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2021-03-29 19:17:11 (GMT)
commit54ad3e4958952f5e0472a163f0c565592be412f9 (patch)
tree21a375e2a6cbd474d72c137bbfa67c83fda9d322
parentd212d91f14d2f2ed4f77ea7f190bbea2a4f6e302 (diff)
downloadCMake-54ad3e4958952f5e0472a163f0c565592be412f9.zip
CMake-54ad3e4958952f5e0472a163f0c565592be412f9.tar.gz
CMake-54ad3e4958952f5e0472a163f0c565592be412f9.tar.bz2
autogen: Don't include SKIP_AUTOMOC files in depfile
SKIP_AUTOMOC files should not be included in moc processing, which means they shouldn't be included in the depfile either. Remove them. Fixes: #21977
-rw-r--r--Source/cmQtAutoGenInitializer.cxx6
-rw-r--r--Source/cmQtAutoMocUic.cxx7
2 files changed, 10 insertions, 3 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index d4138d9..a1816f1 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -1463,15 +1463,15 @@ bool cmQtAutoGenInitializer::SetupWriteAutogenInfo()
headers.reserve(this->AutogenTarget.Headers.size());
for (auto const& pair : this->AutogenTarget.Headers) {
MUFile const* const muf = pair.second.get();
- if (muf->Generated && !this->CMP0071Accept) {
- continue;
- }
if (muf->SkipMoc) {
moc_skip.insert(muf->FullPath);
}
if (muf->SkipUic) {
uic_skip.insert(muf->FullPath);
}
+ if (muf->Generated && !this->CMP0071Accept) {
+ continue;
+ }
if (muf->MocIt || muf->UicIt) {
headers.emplace_back(muf);
}
diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx
index 1e3bf06..535f786 100644
--- a/Source/cmQtAutoMocUic.cxx
+++ b/Source/cmQtAutoMocUic.cxx
@@ -2248,6 +2248,13 @@ void cmQtAutoMocUicT::JobDepFilesMergeT::Process()
std::for_each(this->MocEval().SourceMappings.begin(),
this->MocEval().SourceMappings.end(), processMappingEntry);
+ // Remove SKIP_AUTOMOC files
+ dependencies.erase(std::remove_if(dependencies.begin(), dependencies.end(),
+ [this](const std::string& dep) {
+ return this->MocConst().skipped(dep);
+ }),
+ dependencies.end());
+
// Remove duplicates to make the depfile smaller
std::sort(dependencies.begin(), dependencies.end());
dependencies.erase(std::unique(dependencies.begin(), dependencies.end()),