aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbutl/b.cxx2
-rw-r--r--libbutl/b.mxx6
-rw-r--r--libbutl/utility.mxx2
-rw-r--r--tests/b-info/driver.cxx7
4 files changed, 13 insertions, 4 deletions
diff --git a/libbutl/b.cxx b/libbutl/b.cxx
index a071bba..e1caa4c 100644
--- a/libbutl/b.cxx
+++ b/libbutl/b.cxx
@@ -73,6 +73,7 @@ namespace butl
b_project_info
b_info (const dir_path& project,
+ bool ext_mods,
uint16_t verb,
const function<b_callback>& cmd_callback,
const path& program,
@@ -111,6 +112,7 @@ namespace butl
2 /* stderr */,
pp,
vops,
+ ext_mods ? nullptr : "--no-external-modules",
"-s",
ops,
"info:", "'" + project.representation () + "'");
diff --git a/libbutl/b.mxx b/libbutl/b.mxx
index 6eaf473..9e12711 100644
--- a/libbutl/b.mxx
+++ b/libbutl/b.mxx
@@ -67,6 +67,11 @@ LIBBUTL_MODEXPORT namespace butl
// Run `b info: <project-dir>` command and parse and return the build2
// project information it prints to stdout. Throw b_error on error.
//
+ // Unless you need information that may come from external modules
+ // (operations, meta-operations, etc), pass false as the ext_mods argument,
+ // which results in passing --no-external-modules to the build2 program and
+ // speeds up its execution.
+ //
// You can also specify the build2 verbosity level, command line callback
// (see process_run_callback() for details), build program search details
// and additional options.
@@ -101,6 +106,7 @@ LIBBUTL_MODEXPORT namespace butl
LIBBUTL_SYMEXPORT b_project_info
b_info (const dir_path& project,
+ bool ext_mods,
std::uint16_t verb = 1,
const std::function<b_callback>& cmd_callback = {},
const path& program = path ("b"),
diff --git a/libbutl/utility.mxx b/libbutl/utility.mxx
index a59686b..8a0059a 100644
--- a/libbutl/utility.mxx
+++ b/libbutl/utility.mxx
@@ -271,7 +271,7 @@ LIBBUTL_MODEXPORT namespace butl
// Throw system_error on failure.
//
- // Note that on Windows setting an empty value usets the variable.
+ // Note that on Windows setting an empty value unsets the variable.
//
LIBBUTL_SYMEXPORT void
setenv (const std::string& name, const std::string& value);
diff --git a/tests/b-info/driver.cxx b/tests/b-info/driver.cxx
index 6a3e0a4..3ecfbc0 100644
--- a/tests/b-info/driver.cxx
+++ b/tests/b-info/driver.cxx
@@ -63,10 +63,11 @@ try
cout.exceptions (ios::failbit | ios::badbit);
b_project_info pi (b_info (project,
- 1 /* verb */,
- {} /* cmd_callback */,
+ true /* ext_mods */,
+ 1 /* verb */,
+ {} /* cmd_callback */,
b,
- {} /* search_fallback */,
+ {} /* search_fallback */,
{"--no-default-options"}));
cout << "project: " << pi.project << endl