1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-15 03:48:02 +08:00

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
This commit is contained in:
Kyle Edwards
2021-03-29 15:04:46 -04:00
parent d212d91f14
commit 54ad3e4958
2 changed files with 10 additions and 3 deletions

View File

@@ -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);
}

View File

@@ -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()),