From 32e04ad4b4a8dec07836b7c9fcf90fe72a006990 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 25 Aug 2018 17:40:21 +0200 Subject: Implement missing pieces in utility libraries support In particular, we can now build static libraries out of utility libraries. --- build2/bin/target.hxx | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'build2/bin/target.hxx') diff --git a/build2/bin/target.hxx b/build2/bin/target.hxx index f0b427f..0bcdf90 100644 --- a/build2/bin/target.hxx +++ b/build2/bin/target.hxx @@ -135,7 +135,7 @@ namespace build2 virtual const target_type& dynamic_type () const {return static_type;} }; - // Common base for lib{} and libu{} groups. + // Common base for lib{} and libul{}/libu{} groups. // // We use mtime_target as a base for the "trust me it exists" functionality // which we use, for example, to have installed lib{} prerequisites that @@ -150,13 +150,21 @@ namespace build2 static const target_type static_type; }; - // The libu{} target group (utility library). + // The libul{}/libu{} target groups (utility library). // - // All the members are static libraries that differ base on the kind of + // All the members are static libraries that differ based on the kind of // object files they contains. Note that the group is more like obj{} // rather than lib{} in that one does not build the group directly rather // picking a suitable member. // + // libul{} is a "library utility library" in that the choice of members is + // libua{} or libus{}, even when linking an executable (normally a unit + // test). + // + // libu{} is a general utility library with all three types of members. It + // would normally be used when you want to build both a library from + // libua{}/libus{} and an executable from libue{}. + // class libux: public file // Common base of all libuX{} static libraries. { public: @@ -196,6 +204,16 @@ namespace build2 virtual const target_type& dynamic_type () const {return static_type;} }; + class libul: public libx + { + public: + using libx::libx; + + public: + static const target_type static_type; + virtual const target_type& dynamic_type () const {return static_type;} + }; + class libu: public libx { public: -- cgit v1.1