aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/context.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-05-08 13:21:55 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-05-09 15:37:47 +0200
commitb5d143f529e4ebbeb7a1746312e38da815e2e321 (patch)
tree2275a4619794874f7e8efea1735d46a1912313dc /libbuild2/context.hxx
parent00df206af5c80aba31bf7d180bdf03d617071e94 (diff)
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.
Diffstat (limited to 'libbuild2/context.hxx')
-rw-r--r--libbuild2/context.hxx16
1 files changed, 13 insertions, 3 deletions
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_level> 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_level> match_only = nullopt,
bool no_external_modules = false,
bool dry_run = false,
bool no_diag_buffer = false,