aboutsummaryrefslogtreecommitdiff
path: root/build2/cli
diff options
context:
space:
mode:
Diffstat (limited to 'build2/cli')
-rw-r--r--build2/cli/rule.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/build2/cli/rule.cxx b/build2/cli/rule.cxx
index 6c87490..d07af15 100644
--- a/build2/cli/rule.cxx
+++ b/build2/cli/rule.cxx
@@ -234,9 +234,8 @@ namespace build2
// We use depdb to track changes to the .cli file name, options,
// compiler, etc.
//
+ depdb dd (tp + ".d");
{
- depdb dd (tp + ".d");
-
// First should come the rule name/version.
//
if (dd.expect ("cli.compile 1") != nullptr)
@@ -259,14 +258,14 @@ namespace build2
//
if (dd.expect (s.path ()) != nullptr)
l4 ([&]{trace << "input file mismatch forcing update of " << t;});
+ }
- // Update if depdb mismatch.
- //
- if (dd.writing () || dd.mtime > mt)
- update = true;
+ // Update if depdb mismatch.
+ //
+ if (dd.writing () || dd.mtime > mt)
+ update = true;
- dd.close ();
- }
+ dd.close ();
// If nothing changed, then we are done.
//
@@ -325,6 +324,8 @@ namespace build2
run (cli, args);
+ dd.verify (tp);
+
t.mtime (system_clock::now ());
return target_state::changed;
}