aboutsummaryrefslogtreecommitdiff
path: root/build2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-09-22 11:28:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-09-22 11:28:53 +0200
commitd06e8d1d3b0594c74fa444da76c3c7925ed58f70 (patch)
treea2c6d46e285b8109adc53a7ee2562cd26126a399 /build2
parent9f72ad00a0654bc965ff527615e02fd35596073c (diff)
Add ability to skip external modules during bootstrap (--no-external-modules)
Diffstat (limited to 'build2')
-rw-r--r--build2/b-options.cxx15
-rw-r--r--build2/b-options.hxx4
-rw-r--r--build2/b-options.ixx6
-rw-r--r--build2/b.cli7
-rw-r--r--build2/b.cxx1
5 files changed, 33 insertions, 0 deletions
diff --git a/build2/b-options.cxx b/build2/b-options.cxx
index 95772bb..316d7ad 100644
--- a/build2/b-options.cxx
+++ b/build2/b-options.cxx
@@ -698,6 +698,7 @@ namespace build2
serial_stop_ (),
dry_run_ (),
match_only_ (),
+ no_external_modules_ (),
structured_result_ (),
mtime_check_ (),
no_mtime_check_ (),
@@ -898,6 +899,12 @@ namespace build2
this->match_only_, a.match_only_);
}
+ if (a.no_external_modules_)
+ {
+ ::build2::cl::parser< bool>::merge (
+ this->no_external_modules_, a.no_external_modules_);
+ }
+
if (a.structured_result_)
{
::build2::cl::parser< bool>::merge (
@@ -1110,6 +1117,12 @@ namespace build2
<< " mode is primarily useful for profiling." << ::std::endl;
os << std::endl
+ << "\033[1m--no-external-modules\033[0m Don't load external modules during project bootstrap." << ::std::endl
+ << " Note that this option can only be used with" << ::std::endl
+ << " meta-operations that do not load the project's" << ::std::endl
+ << " \033[1mbuildfiles\033[0m, such as \033[1minfo\033[0m." << ::std::endl;
+
+ os << std::endl
<< "\033[1m--structured-result\033[0m Write the result of execution in a structured form. In" << ::std::endl
<< " this mode, instead of printing to \033[1mSTDERR\033[0m diagnostics" << ::std::endl
<< " messages about the outcome of executing actions on" << ::std::endl
@@ -1267,6 +1280,8 @@ namespace build2
&::build2::cl::thunk< options, bool, &options::dry_run_ >;
_cli_options_map_["--match-only"] =
&::build2::cl::thunk< options, bool, &options::match_only_ >;
+ _cli_options_map_["--no-external-modules"] =
+ &::build2::cl::thunk< options, bool, &options::no_external_modules_ >;
_cli_options_map_["--structured-result"] =
&::build2::cl::thunk< options, bool, &options::structured_result_ >;
_cli_options_map_["--mtime-check"] =
diff --git a/build2/b-options.hxx b/build2/b-options.hxx
index c6f1f59..d55dd36 100644
--- a/build2/b-options.hxx
+++ b/build2/b-options.hxx
@@ -526,6 +526,9 @@ namespace build2
match_only () const;
const bool&
+ no_external_modules () const;
+
+ const bool&
structured_result () const;
const bool&
@@ -628,6 +631,7 @@ namespace build2
bool serial_stop_;
bool dry_run_;
bool match_only_;
+ bool no_external_modules_;
bool structured_result_;
bool mtime_check_;
bool no_mtime_check_;
diff --git a/build2/b-options.ixx b/build2/b-options.ixx
index 6444aa9..1d41af2 100644
--- a/build2/b-options.ixx
+++ b/build2/b-options.ixx
@@ -405,6 +405,12 @@ namespace build2
}
inline const bool& options::
+ no_external_modules () const
+ {
+ return this->no_external_modules_;
+ }
+
+ inline const bool& options::
structured_result () const
{
return this->structured_result_;
diff --git a/build2/b.cli b/build2/b.cli
index 57640b6..a03e9cc 100644
--- a/build2/b.cli
+++ b/build2/b.cli
@@ -535,6 +535,13 @@ namespace build2
useful for profiling."
}
+ bool --no-external-modules
+ {
+ "Don't load external modules during project bootstrap. Note that this
+ option can only be used with meta-operations that do not load the
+ project's \cb{buildfiles}, such as \cb{info}."
+ }
+
bool --structured-result
{
"Write the result of execution in a structured form. In this mode,
diff --git a/build2/b.cxx b/build2/b.cxx
index b7e6708..18326cc 100644
--- a/build2/b.cxx
+++ b/build2/b.cxx
@@ -785,6 +785,7 @@ main (int argc, char* argv[])
ctx.reset (new context (sched,
mutexes,
ops.match_only (),
+ ops.no_external_modules (),
ops.dry_run (),
!ops.serial_stop () /* keep_going */,
cmd_vars));