aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/context.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-02-17 11:37:43 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-02-17 11:37:43 +0200
commit25b6505d26f69715f84d773ae838d6ea19a22c19 (patch)
tree23e5d3d6d98e058a8f7194874af7de62acdabb7c /libbuild2/context.cxx
parentc988a7459c85bc4139cc2e151ddb5758a998ab5a (diff)
Add build.mode global variable
This value signals any special mode the build system may be running in. The two core modes are `no-external-modules` (bootstrapping of external modules is disabled) and `normal` (normal build system execution). Build system drivers may invent additional modes (for example, the bpkg `skeleton` mode that is used to evaluate depends clauses).
Diffstat (limited to 'libbuild2/context.cxx')
-rw-r--r--libbuild2/context.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/libbuild2/context.cxx b/libbuild2/context.cxx
index b7cfa42..d78efba 100644
--- a/libbuild2/context.cxx
+++ b/libbuild2/context.cxx
@@ -141,6 +141,18 @@ namespace build2
v = move (val);
};
+ // Build system mode.
+ //
+ // This value signals any special mode the build system may be running
+ // in. The two core modes are `no-external-modules` (bootstrapping of
+ // external modules is disabled) and `normal` (normal build system
+ // execution). Build system drivers may invent additional modes (for
+ // example, the bpkg `skeleton` mode that is used to evaluate depends
+ // clauses).
+ //
+ set ("build.mode",
+ no_external_modules ? "no-external-modules" : "normal");
+
set ("build.work", work);
set ("build.home", home);