aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/init.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-06-09 13:20:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-06-09 13:20:03 +0200
commitee02acafdcd9bd21d4daf41cee5ca15e94561630 (patch)
tree96e3af4e3b0375571be639180d84ec3de52c2a01 /libbuild2/cc/init.cxx
parent782c437c634dc3c54384e4c3bbcb31ef54910f90 (diff)
Move C++ modules sidebuild to build/cc/build/modules/ subdirectory
Diffstat (limited to 'libbuild2/cc/init.cxx')
-rw-r--r--libbuild2/cc/init.cxx26
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;