From ec203677f1de13c200e54813db73a8ed5be8d4c9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 12 Jul 2020 09:58:44 +0200 Subject: Cache subprojects variable value in scope::root_extra --- libbuild2/scope.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'libbuild2/scope.cxx') diff --git a/libbuild2/scope.cxx b/libbuild2/scope.cxx index 92fc12c..f8fc634 100644 --- a/libbuild2/scope.cxx +++ b/libbuild2/scope.cxx @@ -10,6 +10,24 @@ using namespace std; namespace build2 { + ostream& + operator<< (ostream& os, const subprojects& sps) + { + for (auto b (sps.begin ()), i (b); os && i != sps.end (); ++i) + { + // See find_subprojects() for details. + // + const project_name& n ( + path::traits_type::is_separator (i->first.string ().back ()) + ? empty_project_name + : i->first); + + os << (i != b ? " " : "") << n << '@' << i->second; + } + + return os; + } + // scope // pair scope:: -- cgit v1.1