aboutsummaryrefslogtreecommitdiff
path: root/build2/b.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-12-12 13:21:36 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-12-12 13:21:36 +0200
commitaeae50fe987b1787d1c1ae6f5c0bfb4f179205ef (patch)
treeeee92e23aa81b057688b5cea7fae6487b0470244 /build2/b.cxx
parent272437d0680dc39607140fc041bac9d3cdfbd626 (diff)
Add no_subprojects parameter to info meta-operation
Diffstat (limited to 'build2/b.cxx')
-rw-r--r--build2/b.cxx21
1 files changed, 13 insertions, 8 deletions
diff --git a/build2/b.cxx b/build2/b.cxx
index 0e52d25..2f94bbc 100644
--- a/build2/b.cxx
+++ b/build2/b.cxx
@@ -476,13 +476,13 @@ main (int argc, char* argv[])
// Note: omit reserving anything for the info meta-operation since it
// won't be loading the buildfiles and needs to be as fast as possible.
//
- if (bspec.size () == 1 &&
- bspec.front ().size () == 1 &&
- (bspec.front ().name == "info" ||
- (bspec.front ().name.empty () &&
- bspec.front ().front ().name == "info")))
- ;
- else
+ bool info (bspec.size () == 1 &&
+ bspec.front ().size () == 1 &&
+ (bspec.front ().name == "info" ||
+ (bspec.front ().name.empty () &&
+ bspec.front ().front ().name == "info")));
+
+ if (!info)
pctx->reserve (context::reserves {
30000 /* targets */,
1100 /* variables */});
@@ -895,8 +895,13 @@ main (int argc, char* argv[])
// Now that we have src_root, load the src_root bootstrap file,
// if there is one.
//
+ // As an optimization, omit discovering subprojects for the info
+ // meta-operation if not needed.
+ //
bootstrap_pre (rs, altn);
- bootstrap_src (rs, altn);
+ bootstrap_src (rs, altn,
+ nullopt /* amalgamation */,
+ !info || info_subprojects (mparams) /*subprojects*/);
// If this is a simple project, then implicitly load the test and
// install modules.