From 5974cab56148a18628bfb423189e016ade2d40f9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 31 Aug 2015 13:45:57 +0200 Subject: Rework scoping logic Now the src directory is entered into the scope map and points to the same scope as out. This means that targets that are in src, not out (e.g., source files) will "see" rules, variables, etc. This becomes important when we try, for example, to install a source file (say, a header) from src: we need the rule as well as the install.* variables. --- build/operation.cxx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'build/operation.cxx') diff --git a/build/operation.cxx b/build/operation.cxx index 55a926a..9cc8025 100644 --- a/build/operation.cxx +++ b/build/operation.cxx @@ -62,13 +62,11 @@ namespace build load_root_pre (root); // Create the base scope. Note that its existence doesn't - // mean it was already processed as a base scope; it can - // be the same as root. + // mean it was already setup as a base scope; it can be the + // same as root. // - scope& base (scopes[out_base]); - - base.assign ("out_base") = out_base; - base.src_path_ = &as (base.assign ("src_base") = src_base); + auto i (scopes.insert (out_base, nullptr, true, false)); + scope& base (setup_base (i, out_base, src_base)); // Load the buildfile unless it has already been loaded. // -- cgit v1.1