diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-01-23 10:53:33 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-01-23 10:53:33 +0200 |
commit | 1c7d67d9895c2bdbef13541b154ea17d25b8d515 (patch) | |
tree | ac06cf710a0104c51fdb4c4c47db3e245ac2c793 /build2/parser.cxx | |
parent | 91495e646c688eade6b46f21bb40e3da8b8d6f1a (diff) |
Go back to storing scope instead of target in prerequisite
Turns out this was semantically the right way to do it.
Diffstat (limited to 'build2/parser.cxx')
-rw-r--r-- | build2/parser.cxx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/build2/parser.cxx b/build2/parser.cxx index 9d118e8..ec9d9e4 100644 --- a/build2/parser.cxx +++ b/build2/parser.cxx @@ -693,14 +693,16 @@ namespace build2 dir_path (), move (pn.value), move (e), - tgs.back ()); + *scope_); - // Move last prerequisite (which will normally be the only one). - // - for (target& t: tgs) - t.prerequisites.push_back (&t == &p.owner - ? move (p) - : prerequisite (p, t)); + for (auto i (tgs.begin ()), e (tgs.end ()); i != e; ) + { + // Move last prerequisite (which will normally be the only + // one). + // + target& t (*i); + t.prerequisites.push_back (++i == e ? move (p) : p); + } } } @@ -3552,7 +3554,7 @@ namespace build2 false, // Enter as real (not implied). trace).first); - ct.prerequisites.emplace_back (dt, ct); + ct.prerequisites.emplace_back (prerequisite (dt)); } void parser:: |