From bf959a7fc119f9156c4b84c9d0a10900d9153f8d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 27 Jul 2017 14:45:05 +0200 Subject: Initial infrastructure for utility libraries --- build2/bin/target.cxx | 78 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 75 insertions(+), 3 deletions(-) (limited to 'build2/bin/target.cxx') 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 static pair> @@ -61,6 +85,18 @@ namespace build2 false }; + const target_type libue::static_type + { + "libue", + &libux::static_type, + &m_factory, + &target_extension_var, + &target_pattern_var, + 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, + &target_extension_var, + &target_pattern_var, + 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, + &target_extension_var, + &target_pattern_var, + nullptr, + &target_search, // Note: not _file(); don't look for an existing file. + false + }; + + // obj{}, bmi{}, and libu{} group factory. // template static pair> @@ -164,6 +224,18 @@ namespace build2 false }; + const target_type libu::static_type + { + "libu", + &libx::static_type, + &g_factory, + 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, -- cgit v1.1