diff options
Diffstat (limited to 'libbuild2/cc')
-rw-r--r-- | libbuild2/cc/compile-rule.cxx | 2 | ||||
-rw-r--r-- | libbuild2/cc/init.cxx | 26 | ||||
-rw-r--r-- | libbuild2/cc/utility.cxx | 4 | ||||
-rw-r--r-- | libbuild2/cc/utility.hxx | 7 |
4 files changed, 26 insertions, 13 deletions
diff --git a/libbuild2/cc/compile-rule.cxx b/libbuild2/cc/compile-rule.cxx index cb9da94..1758749 100644 --- a/libbuild2/cc/compile-rule.cxx +++ b/libbuild2/cc/compile-rule.cxx @@ -5283,7 +5283,7 @@ namespace build2 // dir_path pd (as->out_path () / as->root_extra->build_dir / - modules_sidebuild_dir /= + module_build_modules_dir /= x); const scope* ps (&ctx.scopes.find (pd)); 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; diff --git a/libbuild2/cc/utility.cxx b/libbuild2/cc/utility.cxx index f29fa25..93f94ae 100644 --- a/libbuild2/cc/utility.cxx +++ b/libbuild2/cc/utility.cxx @@ -19,7 +19,9 @@ namespace build2 using namespace bin; const dir_path module_dir ("cc"); - const dir_path modules_sidebuild_dir (dir_path (module_dir) /= "modules"); + const dir_path module_build_dir (dir_path (module_dir) /= "build"); + const dir_path module_build_modules_dir ( + dir_path (module_build_dir) /= "modules"); lorder link_order (const scope& bs, otype ot) diff --git a/libbuild2/cc/utility.hxx b/libbuild2/cc/utility.hxx index 017765b..5aef14c 100644 --- a/libbuild2/cc/utility.hxx +++ b/libbuild2/cc/utility.hxx @@ -19,10 +19,11 @@ namespace build2 { // To form the complete path do: // - // root.out_path () / root.root_extra->build_dir / module_dir + // root.out_path () / root.root_extra->build_dir / X_dir // - extern const dir_path module_dir; // cc/ - extern const dir_path modules_sidebuild_dir; // cc/modules/ + extern const dir_path module_dir; // cc/ + extern const dir_path module_build_dir; // cc/build/ + extern const dir_path module_build_modules_dir; // cc/build/modules/ // Compile output type. // |