From 5fac16471ba789965a72ffbbea406b75d8a680dc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 15 Jul 2016 12:49:32 +0200 Subject: Always generate separate object files for liba{} and libso{} While on some platforms they sometimes can be the same, they could also be built differently (e.g., based on command line macros, etc). I guess we could compare the set of options and if they are identical, then use the same file. But that will complicate things quite a bit, so maybe in version 2. --- build2/cxx/link.cxx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/build2/cxx/link.cxx b/build2/cxx/link.cxx index 6bfc1bf..181c2b8 100644 --- a/build2/cxx/link.cxx +++ b/build2/cxx/link.cxx @@ -585,11 +585,7 @@ namespace build2 type lt (link_type (t)); order lo (link_order (t)); - - // Some targets have all object files the same. - // bool so (lt == type::so); - bool oso (so && tclass != "macosx" && tclass != "windows"); // Derive file name from target name. // @@ -762,10 +758,10 @@ namespace build2 // if (obj* o = pt->is_a ()) { - pt = oso ? static_cast (o->so) : o->a; + pt = so ? static_cast (o->so) : o->a; if (pt == nullptr) - pt = &search (oso ? objso::static_type : obja::static_type, + pt = &search (so ? objso::static_type : obja::static_type, p.key ()); } else if (lib* l = pt->is_a ()) @@ -792,7 +788,7 @@ namespace build2 const target_type& otype ( group ? obj::static_type - : (oso ? objso::static_type : obja::static_type)); + : (so ? objso::static_type : obja::static_type)); // Come up with the obj*{} target. The c(xx){} prerequisite directory // can be relative (to the scope) or absolute. If it is relative, then @@ -842,10 +838,10 @@ namespace build2 if (group) { obj& o (static_cast (ot)); - pt = oso ? static_cast (o.so) : o.a; + pt = so ? static_cast (o.so) : o.a; if (pt == nullptr) - pt = &search (oso ? objso::static_type : obja::static_type, + pt = &search (so ? objso::static_type : obja::static_type, o.dir, o.out, o.name, o.ext, nullptr); } else -- cgit v1.1