From d06e8d1d3b0594c74fa444da76c3c7925ed58f70 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 22 Sep 2020 11:28:53 +0200 Subject: Add ability to skip external modules during bootstrap (--no-external-modules) --- libbuild2/file.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libbuild2/file.cxx') diff --git a/libbuild2/file.cxx b/libbuild2/file.cxx index 2660b9e..67aeb77 100644 --- a/libbuild2/file.cxx +++ b/libbuild2/file.cxx @@ -1431,6 +1431,8 @@ namespace build2 { tracer trace ("load_root"); + context& ctx (root.ctx); + const dir_path& out_root (root.out_path ()); const dir_path& src_root (root.src_path ()); @@ -1442,6 +1444,10 @@ namespace build2 if (root.buildfiles.find (f) != root.buildfiles.end ()) return; + if (ctx.no_external_modules) + fail << "attempt to load project " << root << " after skipped loading " + << "external modules"; + // First load outer roots, if any. // if (scope* rs = root.parent_scope ()->root_scope ()) @@ -1483,7 +1489,7 @@ namespace build2 // Reuse the parser to accumulate the configuration variable information. // - parser p (root.ctx, load_stage::root); + parser p (ctx, load_stage::root); if (he) {source_hooks (p, root, hd, true /* pre */); p.reset ();} if (fe) {source_once (p, root, root, f, root);} -- cgit v1.1