From 6c769243ef185782ba1ae08ef2a9f4ded17f3949 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 14 Dec 2015 16:47:39 +0200 Subject: Make sure we don't link up to lib{} targets that are derived from liba/so{} --- build/bin/target.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'build/bin') diff --git a/build/bin/target.cxx b/build/bin/target.cxx index 6f2d7b5..735c581 100644 --- a/build/bin/target.cxx +++ b/build/bin/target.cxx @@ -91,9 +91,11 @@ namespace build }; static target* - liba_factory (const target_type&, dir_path d, string n, const string* e) + liba_factory (const target_type& t, dir_path d, string n, const string* e) { - lib* l (targets.find (d, n)); + // Only link-up to the group if the types match exactly. + // + lib* l (t == liba::static_type ? targets.find (d, n) : nullptr); liba* a (new liba (move (d), move (n), e)); if ((a->group = l)) @@ -126,9 +128,11 @@ namespace build }; static target* - libso_factory (const target_type&, dir_path d, string n, const string* e) + libso_factory (const target_type& t, dir_path d, string n, const string* e) { - lib* l (targets.find (d, n)); + // Only link-up to the group if the types match exactly. + // + lib* l (t == libso::static_type ? targets.find (d, n) : nullptr); libso* so (new libso (move (d), move (n), e)); if ((so->group = l)) -- cgit v1.1