diff options
Diffstat (limited to 'libbuild2/cc/init.cxx')
-rw-r--r-- | libbuild2/cc/init.cxx | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/libbuild2/cc/init.cxx b/libbuild2/cc/init.cxx index 07051c5..1470a21 100644 --- a/libbuild2/cc/init.cxx +++ b/libbuild2/cc/init.cxx @@ -29,25 +29,35 @@ namespace build2 const dir_path& out_root (rs.out_path ()); - dir_path d (out_root / rs.root_extra->build_dir / modules_sidebuild_dir); + dir_path d (out_root / + rs.root_extra->build_dir / + module_build_modules_dir); if (exists (d)) { if (rmdir_r (ctx, d)) { - // Clean up cc/ if it became empty. + // Clean up cc/build/ if it became empty. // - d = out_root / rs.root_extra->build_dir / module_dir; + d = out_root / rs.root_extra->build_dir / module_build_dir; if (empty (d)) { - rmdir (ctx, d); + rmdir (ctx, d, 2); - // And build/ if it also became empty (e.g., in case of a build - // with a transient configuration). + // Clean up cc/ if it became empty. // - d = out_root / rs.root_extra->build_dir; + d = out_root / rs.root_extra->build_dir / module_dir; if (empty (d)) - rmdir (ctx, d); + { + rmdir (ctx, d, 2); + + // And build/ if it also became empty (e.g., in case of a build + // with a transient configuration). + // + d = out_root / rs.root_extra->build_dir; + if (empty (d)) + rmdir (ctx, d, 2); + } } return target_state::changed; |