Commit 9cebdbec authored by Alexey Edelev's avatar Alexey Edelev Committed by Brad King
Browse files

AUTOUIC: Fix cyclic dependency between generated UI headers and timestamp

Once the generated UI headers are created by UIC they also are involved
into processing in next run on ninja.  Autogen adds `ui_*.h` files to
the deps file `ui_*.h` and this cause timestamp start depend on `ui_*.h`.
Meanwhile `ui_*.h` depend on timestamp because of the explicit rules
added by commit 1265c65b (AUTOUIC: Collect ui header files for Ninja
generator, 2021-02-18, v3.21.0-rc1~600^2).  Avoid adding `ui_*.h` to
deps file at second ninja run.

Fixes: #16776
parent 4ff651eb
Pipeline #238244 waiting for manual action with stages
in 12 minutes and 50 seconds
......@@ -2248,12 +2248,20 @@ void cmQtAutoMocUicT::JobDepFilesMergeT::Process()
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);
// Remove SKIP_AUTOMOC files.
// Also remove AUTOUIC header files to avoid cyclic dependency.
std::remove_if(dependencies.begin(), dependencies.end(),
[this](const std::string& dep) {
return this->MocConst().skipped(dep) ||
[&dep](MappingMapT::value_type const& mapping) {
return dep == mapping.second->OutputFile;
// Remove duplicates to make the depfile smaller
std::sort(dependencies.begin(), dependencies.end());
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment