aboutsummaryrefslogtreecommitdiff
path: root/build/rule.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build/rule.cxx')
-rw-r--r--build/rule.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/build/rule.cxx b/build/rule.cxx
index 9f17a2c..97cd20f 100644
--- a/build/rule.cxx
+++ b/build/rule.cxx
@@ -242,8 +242,13 @@ namespace build
//
switch (rs)
{
- case rmdir_status::success: ts |= target_state::changed;
- case rmdir_status::not_empty: ts |= target_state::postponed;
+ case rmdir_status::success: ts |= target_state::changed; break;
+ case rmdir_status::not_empty:
+ {
+ if (!work.sub (t.dir)) // No use postponing removing working directory.
+ ts |= target_state::postponed;
+ break;
+ }
default: break;
}