aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/bin/init.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/bin/init.cxx')
-rw-r--r--libbuild2/bin/init.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/libbuild2/bin/init.cxx b/libbuild2/bin/init.cxx
index a1ac61e..0d2d9b5 100644
--- a/libbuild2/bin/init.cxx
+++ b/libbuild2/bin/init.cxx
@@ -6,6 +6,7 @@
#include <map>
#include <libbuild2/scope.hxx>
+#include <libbuild2/function.hxx>
#include <libbuild2/variable.hxx>
#include <libbuild2/diagnostics.hxx>
@@ -137,6 +138,9 @@ namespace build2
return true;
}
+ void
+ functions (function_map&); // functions.cxx
+
bool
config_init (scope& rs,
scope& bs,
@@ -153,6 +157,14 @@ namespace build2
if (rs != bs)
fail (loc) << "bin.config module must be loaded in project root";
+ context& ctx (rs.ctx);
+
+ // Register the bin function family if this is the first instance of the
+ // bin modules.
+ //
+ if (!function_family::defined (ctx.functions, "bin"))
+ functions (ctx.functions);
+
// Load bin.vars.
//
load_module (rs, rs, "bin.vars", loc);
@@ -267,7 +279,7 @@ namespace build2
// config.bin.target
//
{
- const variable& var (rs.ctx.var_pool["config.bin.target"]);
+ const variable& var (ctx.var_pool["config.bin.target"]);
// We first see if the value was specified via the configuration
// mechanism.
@@ -343,7 +355,7 @@ namespace build2
// config.bin.pattern
//
{
- const variable& var (rs.ctx.var_pool["config.bin.pattern"]);
+ const variable& var (ctx.var_pool["config.bin.pattern"]);
// We first see if the value was specified via the configuration
// mechanism.