From 3c8d1eef72832a86bd85b7cb2629b672e174e651 Mon Sep 17 00:00:00 2001 From: Marc Chevrier Date: Sat, 18 Nov 2023 15:40:41 +0100 Subject: 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 --- Source/cmGccDepfileLexerHelper.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmGccDepfileLexerHelper.cxx b/Source/cmGccDepfileLexerHelper.cxx index 87377de..ae8892a 100644 --- a/Source/cmGccDepfileLexerHelper.cxx +++ b/Source/cmGccDepfileLexerHelper.cxx @@ -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; -- cgit v0.12