aboutsummaryrefslogtreecommitdiff
path: root/build/cxx/link
diff options
context:
space:
mode:
Diffstat (limited to 'build/cxx/link')
-rw-r--r--build/cxx/link22
1 files changed, 22 insertions, 0 deletions
diff --git a/build/cxx/link b/build/cxx/link
index 5d3d29e..5a5aafa 100644
--- a/build/cxx/link
+++ b/build/cxx/link
@@ -12,6 +12,8 @@
#include <build/types>
#include <build/rule>
+#include <build/bin/target>
+
namespace build
{
namespace cxx
@@ -30,6 +32,26 @@ namespace build
static link instance;
+ public:
+ enum class type {e, a, so};
+ enum class order {a, so, a_so, so_a};
+
+ static type
+ link_type (target& t)
+ {
+ return t.is_a<bin::exe> ()
+ ? type::e
+ : (t.is_a<bin::liba> () ? type::a : type::so);
+ }
+
+ static order
+ link_order (target&);
+
+ // Determine the library member (liba or libso) to link.
+ //
+ static target&
+ link_member (bin::lib&, order);
+
private:
friend class compile;