diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-10-26 12:33:34 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-10-26 12:37:28 +0200 |
commit | d3b4636ca3f4c3ad98c8096326c5b1460d05691d (patch) | |
tree | 8d3e8564cd8019f8ea94b31fbff21ce747ef23cd /libbuild2/algorithm.cxx | |
parent | a3d5de5dfecc694d15f23ed03d13cb108dda3e1b (diff) |
Add inject_fsdir_direct(), fsdir_rule::perform_clean_direct() functions
Diffstat (limited to 'libbuild2/algorithm.cxx')
-rw-r--r-- | libbuild2/algorithm.cxx | 25 |
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. // |