From b5d143f529e4ebbeb7a1746312e38da815e2e321 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 8 May 2023 13:21:55 +0200 Subject: Add --load-only option in addition to --match-only This option has the effect of loading all the subdirectory buildfiles that are not explicitly included. --- libbuild2/rule.cxx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'libbuild2/rule.cxx') diff --git a/libbuild2/rule.cxx b/libbuild2/rule.cxx index 5d456d5..0b401c2 100644 --- a/libbuild2/rule.cxx +++ b/libbuild2/rule.cxx @@ -219,7 +219,23 @@ namespace build2 // inject_fsdir (a, t, true, false); - match_prerequisites (a, t); + // Handle the alias match-only level. + // + match_search ms; + if (t.ctx.match_only && *t.ctx.match_only == match_only_level::alias) + { + ms = [] (action, + const target& t, + const prerequisite& p, + include_type i) + { + return prerequisite_target ( + p.is_a () ? &search (t, p) : nullptr, + i); + }; + } + + match_prerequisites (a, t, ms); return default_recipe; } -- cgit v1.1