From 9891b20350021ce41a950645dd76df20a45c92cc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 2 Dec 2015 11:37:15 +0200 Subject: Implement optional module loading The syntax is: using? cli Now each module use results in two bool variables: .loaded and .configured. Also implement variable visibility (the above two variables are limited to project). --- build/config/module.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'build/config/module.cxx') diff --git a/build/config/module.cxx b/build/config/module.cxx index bb787a0..b95c6c7 100644 --- a/build/config/module.cxx +++ b/build/config/module.cxx @@ -24,12 +24,13 @@ namespace build // static const path config_file ("build/config.build"); - extern "C" void + extern "C" bool config_init (scope& r, scope& b, const location& l, std::unique_ptr&, - bool first) + bool first, + bool) { tracer trace ("config::init"); @@ -39,7 +40,7 @@ namespace build if (!first) { warn (l) << "multiple config module initializations"; - return; + return true; } const dir_path& out_root (r.out_path ()); @@ -65,6 +66,8 @@ namespace build if (file_exists (f)) source (f, r, r); + + return true; } } } -- cgit v1.1