aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/utility.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-07-27 14:45:05 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-07-27 14:45:05 +0200
commitbf959a7fc119f9156c4b84c9d0a10900d9153f8d (patch)
treed19b96238f58e305d936d186901edd1cf98e0c93 /build2/cc/utility.ixx
parent24f74ea70a19ccd7bcb489853fc73a972ab8638f (diff)
Initial infrastructure for utility libraries
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