aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-07-15 12:49:32 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-07-15 12:49:32 +0200
commit5fac16471ba789965a72ffbbea406b75d8a680dc (patch)
tree920092f7d1c035b2d429bc14973f3bbf2aa10635
parent70ec3eba9ef98e018e0491b559874c41734193c7 (diff)
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.
-rw-r--r--build2/cxx/link.cxx14
1 files 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<obj> ())
{
- pt = oso ? static_cast<target*> (o->so) : o->a;
+ pt = so ? static_cast<target*> (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<lib> ())
@@ -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<obj&> (ot));
- pt = oso ? static_cast<target*> (o.so) : o.a;
+ pt = so ? static_cast<target*> (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