From a14b9bc18431c6aed8441261d28b6ff20bd25935 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 11 Apr 2019 14:44:32 +0200 Subject: Initial take on header unit and include translation support --- build2/bin/target.hxx | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) (limited to 'build2/bin/target.hxx') diff --git a/build2/bin/target.hxx b/build2/bin/target.hxx index 42295d0..1430477 100644 --- a/build2/bin/target.hxx +++ b/build2/bin/target.hxx @@ -65,7 +65,7 @@ namespace build2 virtual const target_type& dynamic_type () const {return static_type;} }; - // Binary module interface. + // Binary module interface (BMI). // // While currently there are only C++ modules, if things pan out, chances // are we will have C (or Obj-C) modules. And in that case it is plausible @@ -86,6 +86,12 @@ namespace build2 // organization. So, at least for now, we produce the two at the same time // and make obj*{} an ad hoc member of bmi*{}. // + // There are also header units for which we define a parallel hbmi*{} + // hierarchy. Note that hbmix{} is-a bmix{} (we think of header BMIs as a + // more specialized kind of BMI) so where you need to distinguish between + // header and module BMIs, you should check for headers first. Note also + // that in case of a header unit there may be no obj*{}. + // class bmix: public file // Common base of all bmiX{} interface files. { public: @@ -95,6 +101,15 @@ namespace build2 static const target_type static_type; }; + class hbmix: public bmix // Common base of all hbmiX{} interface files. + { + public: + using bmix::bmix; + + public: + static const target_type static_type; + }; + class bmie: public bmix { public: @@ -105,6 +120,16 @@ namespace build2 virtual const target_type& dynamic_type () const {return static_type;} }; + class hbmie: public hbmix + { + public: + using hbmix::hbmix; + + public: + static const target_type static_type; + virtual const target_type& dynamic_type () const {return static_type;} + }; + class bmia: public bmix { public: @@ -115,6 +140,16 @@ namespace build2 virtual const target_type& dynamic_type () const {return static_type;} }; + class hbmia: public hbmix + { + public: + using hbmix::hbmix; + + public: + static const target_type static_type; + virtual const target_type& dynamic_type () const {return static_type;} + }; + class bmis: public bmix { public: @@ -125,6 +160,16 @@ namespace build2 virtual const target_type& dynamic_type () const {return static_type;} }; + class hbmis: public hbmix + { + public: + using hbmix::hbmix; + + public: + static const target_type static_type; + virtual const target_type& dynamic_type () const {return static_type;} + }; + class bmi: public target { public: @@ -135,6 +180,17 @@ namespace build2 virtual const target_type& dynamic_type () const {return static_type;} }; + class hbmi: public target + { + public: + using target::target; + + public: + static const target_type static_type; + virtual const target_type& dynamic_type () const {return static_type;} + }; + + // Common base for lib{} and libul{}/libu{} groups. // // We use mtime_target as a base for the "trust me it exists" functionality -- cgit v1.1