diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-12-02 11:37:15 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-12-02 11:37:15 +0200 |
commit | 9891b20350021ce41a950645dd76df20a45c92cc (patch) | |
tree | 0cd27041b0c3413e17b9319ae99e87c5e745b1ff /build/bin/module.cxx | |
parent | 74212589a797ca75e55f92a522e198915c0dbaf6 (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/bin/module.cxx')
-rw-r--r-- | build/bin/module.cxx | 25 |
1 files changed, 14 insertions, 11 deletions
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<module>&, - 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<liba> (b, dir_path ("lib")); // Install into install.lib. install::mode<liba> (b, "644"); + + return true; } } } |