aboutsummaryrefslogtreecommitdiff
path: root/build/dist/module.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-12-02 11:37:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-12-02 11:37:15 +0200
commit9891b20350021ce41a950645dd76df20a45c92cc (patch)
tree0cd27041b0c3413e17b9319ae99e87c5e745b1ff /build/dist/module.cxx
parent74212589a797ca75e55f92a522e198915c0dbaf6 (diff)
Implement optional module loading
The syntax is: using? cli Now each module use results in two bool variables: <module>.loaded and <module>.configured. Also implement variable visibility (the above two variables are limited to project).
Diffstat (limited to 'build/dist/module.cxx')
-rw-r--r--build/dist/module.cxx27
1 files changed, 15 insertions, 12 deletions
diff --git a/build/dist/module.cxx b/build/dist/module.cxx
index 9bd058a..a624c20 100644
--- a/build/dist/module.cxx
+++ b/build/dist/module.cxx
@@ -22,12 +22,13 @@ namespace build
{
static rule rule_;
- extern "C" void
+ extern "C" bool
dist_init (scope& r,
scope& b,
const location& l,
- std::unique_ptr<module>&,
- bool first)
+ unique_ptr<module>&,
+ bool first,
+ bool)
{
tracer trace ("dist::init");
@@ -37,7 +38,7 @@ namespace build
if (!first)
{
warn (l) << "multiple dist module initializations";
- return;
+ return true;
}
const dir_path& out_root (r.out_path ());
@@ -58,20 +59,20 @@ namespace build
//
if (first)
{
- variable_pool.find ("dist", bool_type);
+ var_pool.find ("dist", bool_type);
- variable_pool.find ("dist.package", string_type);
+ var_pool.find ("dist.package", string_type);
- variable_pool.find ("dist.root", dir_path_type);
- variable_pool.find ("config.dist.root", dir_path_type);
+ var_pool.find ("dist.root", dir_path_type);
+ var_pool.find ("config.dist.root", dir_path_type);
//@@ VAR type
//
- variable_pool.find ("dist.cmd", string_type);
- variable_pool.find ("config.dist.cmd", string_type);
+ var_pool.find ("dist.cmd", string_type);
+ var_pool.find ("config.dist.cmd", string_type);
- variable_pool.find ("dist.archives", strings_type);
- variable_pool.find ("config.dist.archives", strings_type);
+ var_pool.find ("dist.archives", strings_type);
+ var_pool.find ("config.dist.archives", strings_type);
}
// Configuration.
@@ -127,6 +128,8 @@ namespace build
v = cv;
}
}
+
+ return true;
}
}
}