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/bin/module.cxx | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'build/bin/module.cxx') diff --git a/build/bin/module.cxx b/build/bin/module.cxx index 25700c6..c7da647 100644 --- a/build/bin/module.cxx +++ b/build/bin/module.cxx @@ -29,12 +29,13 @@ namespace build static const strings liba_lib {"static"}; static const strings libso_lib {"shared"}; - extern "C" void + extern "C" bool bin_init (scope& r, scope& b, const location&, std::unique_ptr&, - bool first) + bool first, + bool) { tracer trace ("bin::init"); level5 ([&]{trace << "for " << b.out_path ();}); @@ -81,15 +82,15 @@ namespace build // if (first) { - variable_pool.find ("config.bin.lib", string_type); - variable_pool.find ("config.bin.exe.lib", strings_type); - variable_pool.find ("config.bin.liba.lib", strings_type); - variable_pool.find ("config.bin.libso.lib", strings_type); - - variable_pool.find ("bin.lib", string_type); - variable_pool.find ("bin.exe.lib", strings_type); - variable_pool.find ("bin.liba.lib", strings_type); - variable_pool.find ("bin.libso.lib", strings_type); + var_pool.find ("config.bin.lib", string_type); + var_pool.find ("config.bin.exe.lib", strings_type); + var_pool.find ("config.bin.liba.lib", strings_type); + var_pool.find ("config.bin.libso.lib", strings_type); + + var_pool.find ("bin.lib", string_type); + var_pool.find ("bin.exe.lib", strings_type); + var_pool.find ("bin.liba.lib", strings_type); + var_pool.find ("bin.libso.lib", strings_type); } // Configure. @@ -164,6 +165,8 @@ namespace build install::path (b, dir_path ("lib")); // Install into install.lib. install::mode (b, "644"); + + return true; } } } -- cgit v1.1