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/file | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'build/file') diff --git a/build/file b/build/file index 64d8ad2..c2b2535 100644 --- a/build/file +++ b/build/file @@ -9,11 +9,11 @@ #include #include +#include #include // list_value namespace build { - class scope; class target; class location; class prerequisite_key; @@ -68,6 +68,19 @@ namespace build scope& create_root (const dir_path& out_root, const dir_path& src_root); + // Setup root scope. Note that it assume the src_root variable + // has already been set. + // + void + setup_root (scope&); + + // Setup the base scope (set *_base variables, etc). + // + scope& + setup_base (scope_map::iterator, + const dir_path& out_base, + const dir_path& src_base); + // Bootstrap the project's root scope, the out part. // void -- cgit v1.1