From dee4003df645803a7883fd7b97dab7ca6b1f79ae Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 27 Aug 2019 23:51:46 +0300 Subject: Add build2_cli_load() --- build2/cli/init.cxx | 16 ++++++++++++++++ build2/cli/init.hxx | 26 +++++++++----------------- 2 files changed, 25 insertions(+), 17 deletions(-) (limited to 'build2/cli') diff --git a/build2/cli/init.cxx b/build2/cli/init.cxx index 7b7a519..67aad29 100644 --- a/build2/cli/init.cxx +++ b/build2/cli/init.cxx @@ -368,5 +368,21 @@ namespace build2 return true; } + + static const module_functions mod_functions[] = + { + // NOTE: don't forget to also update the documentation in init.hxx if + // changing anything here. + + {"cli.config", nullptr, config_init}, + {"cli", nullptr, init}, + {nullptr, nullptr, nullptr} + }; + + const module_functions* + build2_cli_load () + { + return mod_functions; + } } } diff --git a/build2/cli/init.hxx b/build2/cli/init.hxx index 341dc11..4bb7d0d 100644 --- a/build2/cli/init.hxx +++ b/build2/cli/init.hxx @@ -14,23 +14,15 @@ namespace build2 { namespace cli { - bool - config_init (scope&, - scope&, - const location&, - unique_ptr&, - bool, - bool, - const variable_map&); - - bool - init (scope&, - scope&, - const location&, - unique_ptr&, - bool, - bool, - const variable_map&); + // Module `cli` does not require bootstrapping. + // + // Submodules: + // + // `cli.config` -- registers variables. + // `cli` -- loads cli.config and registers target types and rules. + // + extern "C" const module_functions* + build2_cli_load (); } } -- cgit v1.1