aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/algorithm.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/algorithm.cxx')
-rw-r--r--libbuild2/algorithm.cxx25
1 files changed, 24 insertions, 1 deletions
diff --git a/libbuild2/algorithm.cxx b/libbuild2/algorithm.cxx
index bd64cb1..01d5016 100644
--- a/libbuild2/algorithm.cxx
+++ b/libbuild2/algorithm.cxx
@@ -1593,7 +1593,7 @@ namespace build2
}
const fsdir*
- inject_fsdir (action a, target& t, bool prereq, bool parent)
+ inject_fsdir_impl (target& t, bool prereq, bool parent)
{
tracer trace ("inject_fsdir");
@@ -1614,6 +1614,7 @@ namespace build2
// subprojects (e.g., tests/).
//
const fsdir* r (nullptr);
+
if (rs != nullptr && !d.sub (rs->src_path ()))
{
l6 ([&]{trace << d << " for " << t;});
@@ -1641,6 +1642,14 @@ namespace build2
}
}
+ return r;
+ }
+
+ const fsdir*
+ inject_fsdir (action a, target& t, bool prereq, bool parent)
+ {
+ const fsdir* r (inject_fsdir_impl (t, prereq, parent));
+
if (r != nullptr)
{
// Make it ad hoc so that it doesn't end up in prerequisite_targets
@@ -1653,6 +1662,20 @@ namespace build2
return r;
}
+ const fsdir*
+ inject_fsdir_direct (action a, target& t, bool prereq, bool parent)
+ {
+ const fsdir* r (inject_fsdir_impl (t, prereq, parent));
+
+ if (r != nullptr)
+ {
+ match_direct_sync (a, *r);
+ t.prerequisite_targets[a].emplace_back (r, include_type::adhoc);
+ }
+
+ return r;
+ }
+
// Execute the specified recipe (if any) and the scope operation callbacks
// (if any/applicable) then merge and return the resulting target state.
//