From 51267fc81abdbf0ca7f1098fccd7f3e0d7da5306 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 9 Mar 2016 11:06:26 +0200 Subject: Force creation of output directory before opening depdb --- build2/algorithm.cxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'build2/algorithm.cxx') diff --git a/build2/algorithm.cxx b/build2/algorithm.cxx index 89dd029..80325ed 100644 --- a/build2/algorithm.cxx +++ b/build2/algorithm.cxx @@ -300,7 +300,7 @@ namespace build2 } } - void + fsdir* inject_parent_fsdir (action a, target& t) { tracer trace ("inject_parent_fsdir"); @@ -309,7 +309,7 @@ namespace build2 scope* rs (s.root_scope ()); if (rs == nullptr) // Could be outside any project. - return; + return nullptr; const dir_path& out_root (rs->out_path ()); @@ -318,14 +318,15 @@ namespace build2 // const dir_path& d (t.name.empty () ? t.dir.directory () : t.dir); - if (!d.sub (out_root) || d == out_root) - return; + if (!d.sub (out_root)) + return nullptr; l6 ([&]{trace << "for " << t;}); - fsdir& dt (search (d, string (), nullptr, &s)); - match (a, dt); - t.prerequisite_targets.emplace_back (&dt); + fsdir* r (&search (d, string (), nullptr, &s)); + match (a, *r); + t.prerequisite_targets.emplace_back (r); + return r; } target_state -- cgit v1.1