aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build2/algorithm10
-rw-r--r--build2/algorithm.cxx10
2 files changed, 11 insertions, 9 deletions
diff --git a/build2/algorithm b/build2/algorithm
index b1c922b..9401915 100644
--- a/build2/algorithm
+++ b/build2/algorithm
@@ -131,11 +131,11 @@ namespace build2
resolve_group_members (action, target&);
// Inject dependency on the target's directory fsdir{}, unless it is in the
- // src tree, root of the project, or is outside of any project (say, for
- // example, an installation directory). If the parent argument is true, then
- // inject the parent directory of a target that is itself a directory (name
- // is empty). Return the injected target or NULL. Normally this function is
- // called from the rule's apply() function.
+ // src tree or is outside of any project (say, for example, an installation
+ // directory). If the parent argument is true, then inject the parent
+ // directory of a target that is itself a directory (name is empty). Return
+ // the injected target or NULL. Normally this function is called from the
+ // rule's apply() function.
//
fsdir*
inject_fsdir (action, target&, bool parent = true);
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;});