diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-06-09 12:50:18 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-06-09 12:50:18 +0200 |
commit | 782c437c634dc3c54384e4c3bbcb31ef54910f90 (patch) | |
tree | 8a1088682eded0db71c9e11535a296c478f49bf2 /libbuild2/rule.cxx | |
parent | b256e5ce05c045e6d536c728776342a5c45c5995 (diff) |
Move recipe build directory to build/build/recipes/
Our new scheme is to have any "out" content in a subdirectory called build/
(build/build/ for the build system core, build/<module>/build/ for modules).
This way we can ignore them in .gitignore with a generic entry.
Diffstat (limited to 'libbuild2/rule.cxx')
-rw-r--r-- | libbuild2/rule.cxx | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/libbuild2/rule.cxx b/libbuild2/rule.cxx index 86a6b4d..9028096 100644 --- a/libbuild2/rule.cxx +++ b/libbuild2/rule.cxx @@ -310,7 +310,7 @@ namespace build2 // adhoc_rule // - const dir_path adhoc_rule::recipes_build_dir ("recipes.out"); + const dir_path adhoc_rule::recipes_build_dir ("recipes"); bool adhoc_rule:: match (action a, target& t, const string& h, optional<action> fallback) const @@ -338,18 +338,26 @@ namespace build2 const dir_path& out_root (rs.out_path ()); - dir_path d (out_root / rs.root_extra->build_dir / recipes_build_dir); + dir_path d (out_root / rs.root_extra->build_build_dir / recipes_build_dir); if (exists (d)) { if (rmdir_r (ctx, d)) { - // Clean up build/ if it also became empty (e.g., in case of a build - // with a transient configuration). + // Clean up build/build/ if it also became empty. // - d = out_root / rs.root_extra->build_dir; + d = out_root / rs.root_extra->build_build_dir; if (empty (d)) - rmdir (ctx, d); + { + rmdir (ctx, d, 2); + + // Clean up 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; } |