From cd75e06a87aa74aa6968113107afa53d401d20bc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 25 Mar 2015 14:48:36 +0200 Subject: Configure/disfigure src_root saving/removing support; fsdir{} injection We can now build out-of-tree. --- build/config/module.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'build/config/module.cxx') diff --git a/build/config/module.cxx b/build/config/module.cxx index dca6ede..41c2526 100644 --- a/build/config/module.cxx +++ b/build/config/module.cxx @@ -28,15 +28,17 @@ namespace build void init (scope& root, scope& base, const location& l) { - tracer trace ("config::init"); - //@@ TODO: avoid multiple inits (generally, for modules). // - level4 ([&]{trace << "for " << root.path () << '/';}); + + tracer trace ("config::init"); if (&root != &base) fail (l) << "config module must be initialized in project root scope"; + const path& out_root (root.path ()); + level4 ([&]{trace << "for " << out_root << '/';}); + // Register meta-operations. // if (root.meta_operations.insert (configure) != configure_id || @@ -45,7 +47,7 @@ namespace build // Register the build/config.build sourcing trigger. // - root.triggers[path ("build/config.build")] = &trigger; + root.triggers[out_root / path ("build/config.build")] = &trigger; } } } -- cgit v1.1