aboutsummaryrefslogtreecommitdiff
path: root/build/rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-03-13 10:38:11 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-03-13 10:38:11 +0200
commit0cee33621a93d3348a1bf19a0c94441b717cbcbc (patch)
tree1f017e61794f705d9c0b872df108170cc4576b77 /build/rule.cxx
parentcf6b3e34b59ad120111e0c1ead779bbb3a70c38d (diff)
Add postponed recipe execution support
Diffstat (limited to 'build/rule.cxx')
-rw-r--r--build/rule.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/build/rule.cxx b/build/rule.cxx
index 2359445..eb7f5b4 100644
--- a/build/rule.cxx
+++ b/build/rule.cxx
@@ -250,10 +250,7 @@ namespace build
// Wait until the last dependent to get an empty directory.
//
if (t.dependents != 0)
- {
- t.state = target_state::unknown;
- return target_state::unchanged;
- }
+ return target_state::postponed;
// The reverse order of update: first delete this directory,
// then clean prerequisites (e.g., delete parent directories).
@@ -311,6 +308,14 @@ namespace build
if (!t.prerequisites.empty ())
ts = execute_prerequisites (a, t);
- return rs == rmdir_status::success ? target_state::changed : ts;
+ // If we couldn't remove the directory, return postponed meaning
+ // that the operation could not be performed at this time.
+ //
+ switch (rs)
+ {
+ case rmdir_status::success: return target_state::changed;
+ case rmdir_status::not_empty: return target_state::postponed;
+ default: return ts;
+ }
}
}