summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/cmQtAutoMocUic.cxx20
1 files changed, 14 insertions, 6 deletions
diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx
index f5c195fd1d..2753fd57c0 100644
--- a/Source/cmQtAutoMocUic.cxx
+++ b/Source/cmQtAutoMocUic.cxx
@@ -2248,12 +2248,20 @@ 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 SKIP_AUTOMOC files.
+ // Also remove AUTOUIC header files to avoid cyclic dependency.
+ dependencies.erase(
+ std::remove_if(dependencies.begin(), dependencies.end(),
+ [this](const std::string& dep) {
+ return this->MocConst().skipped(dep) ||
+ std::any_of(
+ this->UicEval().Includes.begin(),
+ this->UicEval().Includes.end(),
+ [&dep](MappingMapT::value_type const& mapping) {
+ return dep == mapping.second->OutputFile;
+ });
+ }),
+ dependencies.end());
// Remove duplicates to make the depfile smaller
std::sort(dependencies.begin(), dependencies.end());