diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-07-28 13:46:26 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-07-28 13:46:26 +0200 |
commit | 1c7cbb302b1c6e41eb0c5cecfc655532f1919cba (patch) | |
tree | 84375e8be2bfe00b2387f02cab8dcca396019299 /build2/cc/utility.cxx | |
parent | 24402ed431c1780914576f72350f8796308cb59b (diff) |
Implement support for linking whole archive
Diffstat (limited to 'build2/cc/utility.cxx')
-rw-r--r-- | build2/cc/utility.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/build2/cc/utility.cxx b/build2/cc/utility.cxx index fa5061e..7a2b7fe 100644 --- a/build2/cc/utility.cxx +++ b/build2/cc/utility.cxx @@ -43,12 +43,15 @@ namespace build2 { if (const libu* u = x.is_a<libu> ()) { - otype ot (li.type); - return search (*u, - ot == otype::e ? libue::static_type : - ot == otype::a ? libua::static_type : - libus::static_type, - u->dir, u->out, u->name); + const target_type& tt (li.type == otype::e ? libue::static_type : + li.type == otype::a ? libua::static_type : + libus::static_type); + + // Called by the compile rule during execute. + // + return phase == run_phase::match + ? search (*u, tt, u->dir, u->out, u->name) + : *search_existing (tt, u->dir, u->out, u->name); } else { |