aboutsummaryrefslogtreecommitdiff
path: root/build2/bin/target.cxx
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/bin/target.cxx
parent24f74ea70a19ccd7bcb489853fc73a972ab8638f (diff)
Initial infrastructure for utility libraries
Diffstat (limited to 'build2/bin/target.cxx')
-rw-r--r--build2/bin/target.cxx78
1 files changed, 75 insertions, 3 deletions
diff --git a/build2/bin/target.cxx b/build2/bin/target.cxx
index f0e0152..aa37202 100644
--- a/build2/bin/target.cxx
+++ b/build2/bin/target.cxx
@@ -10,6 +10,30 @@ namespace build2
{
namespace bin
{
+ const target_type libx::static_type
+ {
+ "libx",
+ &target::static_type,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ &target_search,
+ false
+ };
+
+ const target_type libux::static_type
+ {
+ "libux",
+ &file::static_type,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ &target_search,
+ false
+ };
+
// Note that we link groups during the load phase since this is often
// relied upon when setting target-specific variables (e.g., we may set a
// common value for lib{} and then append liba/libs-specific values to
@@ -19,7 +43,7 @@ namespace build2
extern const char ext_var[] = "extension"; // VC14 rejects constexpr.
- // obj*{} and bmi*{} member factory.
+ // obj*{}, bmi*{}, libu*{} member factory.
//
template <typename M, typename G>
static pair<target*, optional<string>>
@@ -61,6 +85,18 @@ namespace build2
false
};
+ const target_type libue::static_type
+ {
+ "libue",
+ &libux::static_type,
+ &m_factory<libue, libu>,
+ &target_extension_var<ext_var, nullptr>,
+ &target_pattern_var<ext_var, nullptr>,
+ nullptr,
+ &target_search, // Note: not _file(); don't look for an existing file.
+ false
+ };
+
const target_type obja::static_type
{
"obja",
@@ -85,6 +121,18 @@ namespace build2
false
};
+ const target_type libua::static_type
+ {
+ "libua",
+ &libux::static_type,
+ &m_factory<libua, libu>,
+ &target_extension_var<ext_var, nullptr>,
+ &target_pattern_var<ext_var, nullptr>,
+ nullptr,
+ &target_search, // Note: not _file(); don't look for an existing file.
+ false
+ };
+
const target_type objs::static_type
{
"objs",
@@ -109,7 +157,19 @@ namespace build2
false
};
- // obj{} and bmi{} group factory.
+ const target_type libus::static_type
+ {
+ "libus",
+ &libux::static_type,
+ &m_factory<libus, libu>,
+ &target_extension_var<ext_var, nullptr>,
+ &target_pattern_var<ext_var, nullptr>,
+ nullptr,
+ &target_search, // Note: not _file(); don't look for an existing file.
+ false
+ };
+
+ // obj{}, bmi{}, and libu{} group factory.
//
template <typename G, typename E, typename A, typename S>
static pair<target*, optional<string>>
@@ -164,6 +224,18 @@ namespace build2
false
};
+ const target_type libu::static_type
+ {
+ "libu",
+ &libx::static_type,
+ &g_factory<libu, libue, libua, libus>,
+ nullptr,
+ nullptr,
+ nullptr,
+ &target_search,
+ false
+ };
+
// What extensions should we use? At the outset, this is platform-
// dependent. And if we consider cross-compilation, is it build or
// host-dependent? Feels like it should be host-dependent so that
@@ -238,7 +310,7 @@ namespace build2
const target_type lib::static_type
{
"lib",
- &target::static_type,
+ &libx::static_type,
&lib_factory,
nullptr,
nullptr,