aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/bin/utility.ixx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/bin/utility.ixx')
-rw-r--r--libbuild2/bin/utility.ixx21
1 files changed, 21 insertions, 0 deletions
diff --git a/libbuild2/bin/utility.ixx b/libbuild2/bin/utility.ixx
new file mode 100644
index 0000000..91c919b
--- /dev/null
+++ b/libbuild2/bin/utility.ixx
@@ -0,0 +1,21 @@
+// file : libbuild2/bin/utility.ixx -*- C++ -*-
+// license : MIT; see accompanying LICENSE file
+
+namespace build2
+{
+ namespace bin
+ {
+ inline ltype
+ link_type (const target& t)
+ {
+ 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};
+ }
+ }
+}