aboutsummaryrefslogtreecommitdiff
path: root/build2/config/module.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/config/module.cxx')
-rw-r--r--build2/config/module.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/build2/config/module.cxx b/build2/config/module.cxx
index 6d2bd70..16eabe9 100644
--- a/build2/config/module.cxx
+++ b/build2/config/module.cxx
@@ -9,6 +9,7 @@
#include <build2/file>
#include <build2/rule>
#include <build2/scope>
+#include <build2/context>
#include <build2/diagnostics>
#include <build2/config/operation>
@@ -20,12 +21,14 @@ namespace build2
{
namespace config
{
+ const string module::name ("config");
+
//@@ Same as in operation.cxx
//
static const path config_file ("build/config.build");
extern "C" void
- config_boot (scope& root, const location&, unique_ptr<module>&)
+ config_boot (scope& root, const location&, unique_ptr<module_base>&)
{
tracer trace ("config::boot");
@@ -54,7 +57,7 @@ namespace build2
config_init (scope& root,
scope&,
const location& l,
- unique_ptr<module>&,
+ unique_ptr<module_base>& mod,
bool first,
bool)
{
@@ -68,6 +71,11 @@ namespace build2
l5 ([&]{trace << "for " << root.out_path ();});
+ // Only create the module if we are configuring.
+ //
+ if (current_mif->id == configure_id)
+ mod.reset (new module);
+
// Register alias and fallback rule for the configure meta-operation.
//
{