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/rule-map | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'build/rule-map') diff --git a/build/rule-map b/build/rule-map index 0ef0036..0ce49e7 100644 --- a/build/rule-map +++ b/build/rule-map @@ -52,6 +52,9 @@ namespace build return map_.size () > oid ? &map_[oid] : nullptr; } + bool + empty () const {return map_.empty ();} + private: std::vector map_; }; @@ -92,6 +95,9 @@ namespace build explicit rule_map (meta_operation_id mid = perform_id): mid_ (mid) {} + bool + empty () const {return map_.empty () && next_ == nullptr;} + private: meta_operation_id mid_; operation_rule_map map_; -- cgit v1.1