From 25b6505d26f69715f84d773ae838d6ea19a22c19 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 17 Feb 2022 11:37:43 +0200 Subject: 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). --- libbuild2/context.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libbuild2') 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); -- cgit v1.1