aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/utility.ixx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/cc/utility.ixx')
-rw-r--r--build2/cc/utility.ixx14
1 files changed, 9 insertions, 5 deletions
diff --git a/build2/cc/utility.ixx b/build2/cc/utility.ixx
index d372dac..d13a0ff 100644
--- a/build2/cc/utility.ixx
+++ b/build2/cc/utility.ixx
@@ -17,15 +17,19 @@ namespace build2
otype::s;
}
- inline otype
+ inline ltype
link_type (const target& t)
{
using namespace bin;
- return
- t.is_a<exe> () ? otype::e :
- t.is_a<liba> () ? otype::a :
- otype::s;
+ bool u (false);
+ otype o (
+ t.is_a<exe> () || (u = t.is_a<libue> ()) ? otype::e :
+ t.is_a<liba> () || (u = t.is_a<libua> ()) ? otype::a :
+ t.is_a<libs> () || (u = t.is_a<libus> ()) ? otype::s :
+ static_cast<otype> (0xFF));
+
+ return ltype {o, u};
}
inline compile_target_types