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/context.hxx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'libbuild2/context.hxx') diff --git a/libbuild2/context.hxx b/libbuild2/context.hxx index b0fac02..7574787 100644 --- a/libbuild2/context.hxx +++ b/libbuild2/context.hxx @@ -120,6 +120,16 @@ namespace build2 } }; + // Match-only level. + // + // See the --match-only and --load-only options for background. + // + enum class match_only_level + { + alias, // Match only alias{} targets. + all // Match all targets. + }; + // A build context encapsulates the state of a build. It is possible to have // multiple build contexts provided they are non-overlapping, that is, they // don't try to build the same projects (note that this is currently not @@ -217,9 +227,9 @@ namespace build2 global_mutexes* mutexes; file_cache* fcache; - // Match only flag (see --match-only but also dist). + // Match only flag/level (see --{load,match}-only but also dist). // - bool match_only; + optional match_only; // Skip booting external modules flag (see --no-external-modules). // @@ -689,7 +699,7 @@ namespace build2 context (scheduler&, global_mutexes&, file_cache&, - bool match_only = false, + optional match_only = nullopt, bool no_external_modules = false, bool dry_run = false, bool no_diag_buffer = false, -- cgit v1.1