Ninja: depfile: keep rules without dependencies

To avoid repeated executions of custom command actions, depfile file
with rules without dependencies must be preserved.

Fixes: #25428
This commit is contained in:
Marc Chevrier
2023-11-18 15:40:41 +01:00
committed by Brad King
parent 9cfff766eb
commit 3c8d1eef72

View File

@@ -145,8 +145,8 @@ void cmGccDepfileLexerHelper::sanitizeContent()
++rit;
}
}
// Remove the entry if rules are empty or do not have any paths
if (it->rules.empty() || it->paths.empty()) {
// Remove the entry if rules are empty
if (it->rules.empty()) {
it = this->Content.erase(it);
} else {
++it;