aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/utility.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/cc/utility.cxx')
-rw-r--r--build2/cc/utility.cxx15
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
{