aboutsummaryrefslogtreecommitdiff
path: root/build2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-06-20 10:18:11 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-06-20 10:18:11 +0200
commit11b477a588efd5369afa29cf65c7fb58377d0649 (patch)
tree6e1c0995adcbd9b5dd4ebb6fcb4647a45a8cca57 /build2
parent1630f7607003cac3579486d21970c7bb98942741 (diff)
Fix bug in bmi{} rule chaining
Diffstat (limited to 'build2')
-rw-r--r--build2/cc/link.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/build2/cc/link.cxx b/build2/cc/link.cxx
index 6d12c4a..a91fa1e 100644
--- a/build2/cc/link.cxx
+++ b/build2/cc/link.cxx
@@ -602,7 +602,7 @@ namespace build2
ps.push_back (p.as_prerequisite ()); // Source.
// Add our lib*{} (see the export.* machinery for details) and
- // bmi*{} (both original and chanined; see module search logic)
+ // bmi*{} (both original and chained; see module search logic)
// prerequisites.
//
// Note that we don't resolve lib{} to liba{}/libs{} here
@@ -634,8 +634,14 @@ namespace build2
//
if (pt != nullptr && i != j) // Don't add self (note: both +1).
{
+ // This is sticky: pt might have come before us and if it
+ // was a group, then we would have picked up a member. So
+ // here we may have to "unpick" it.
+ //
+ bool group (j < i && !p.prerequisite.belongs (t));
+
unmark (pt);
- ps.emplace_back (prerequisite (*pt));
+ ps.emplace_back (prerequisite (group ? *pt->group : *pt));
}
}
}