aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/scope.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-07-12 09:58:44 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-07-12 09:58:44 +0200
commitec203677f1de13c200e54813db73a8ed5be8d4c9 (patch)
tree537f98ff676a6cbc7210e0a7d4fd3ba301882486 /libbuild2/scope.cxx
parentfc4bea587f91e503ab26d15b76ab1e3bf88672b1 (diff)
Cache subprojects variable value in scope::root_extra
Diffstat (limited to 'libbuild2/scope.cxx')
-rw-r--r--libbuild2/scope.cxx18
1 files changed, 18 insertions, 0 deletions
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<lookup, size_t> scope::