aboutsummaryrefslogtreecommitdiff
path: root/build2/cli
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-08-27 23:51:46 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-08-28 15:01:48 +0300
commitdee4003df645803a7883fd7b97dab7ca6b1f79ae (patch)
tree1078faff56d8ffbc2b441bf2b9c59f2927fbba2d /build2/cli
parentac87e3827b214c0ba1bd1c17a2d8a18026637d3f (diff)
Add build2_cli_load()
Diffstat (limited to 'build2/cli')
-rw-r--r--build2/cli/init.cxx16
-rw-r--r--build2/cli/init.hxx26
2 files changed, 25 insertions, 17 deletions
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<module_base>&,
- bool,
- bool,
- const variable_map&);
-
- bool
- init (scope&,
- scope&,
- const location&,
- unique_ptr<module_base>&,
- 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 ();
}
}