aboutsummaryrefslogtreecommitdiff
path: root/build2/algorithm.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-01-12 10:52:12 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-01-12 10:58:19 +0200
commit11b841ef5b26e25500fa4d464f216dc982ed7338 (patch)
tree7a528ce6e098f8867cedbe102b4d06e2411dc5d5 /build2/algorithm.cxx
parent7509a7e07cb047a43664a7d33a5b0ac3a945019a (diff)
Inject fsdir{} even for project roots
This takes care of subprojects, such as tests/.
Diffstat (limited to 'build2/algorithm.cxx')
-rw-r--r--build2/algorithm.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/build2/algorithm.cxx b/build2/algorithm.cxx
index 3a354f9..638afd0 100644
--- a/build2/algorithm.cxx
+++ b/build2/algorithm.cxx
@@ -312,9 +312,11 @@ namespace build2
scope& bs (t.base_scope ());
scope* rs (bs.root_scope ());
- // Handle the outside of any project and at root scope cases.
+ // Handle the outside of any project case. Note that we also used to bail
+ // our of this is the root of the project. But that proved not to be such
+ // a great idea in case of subprojects (e.g., tests/).
//
- if (rs == nullptr || &bs == rs)
+ if (rs == nullptr)
return nullptr;
// If t is a directory (name is empty), say foo/bar/, then t is bar and
@@ -322,9 +324,9 @@ namespace build2
//
const dir_path& d (parent && t.name.empty () ? t.dir.directory () : t.dir);
- // Handle the src = out and (again) root scope cases.
+ // Handle the src = out.
//
- if (d.sub (rs->src_path ()) || d == rs->out_path ())
+ if (d.sub (rs->src_path ()))
return nullptr;
l6 ([&]{trace << d << " for " << t;});