Boost logo

Boost-Build :

From: Ali Azarbayejani (ali_at_[hidden])
Date: 2003-03-28 11:02:01


Vladimir Prus wrote:
>
> > Try the following quiz.
> >
> > Example 1:
> >
> > lib a : $(ASrc) : : : <include>./include/a ;
> > lib b : $(BSrc) a : : : <include>./include/b ;
> > lib c : $(CSrc) b : : : <include>./include/c ;
> > exe D : $(DSrc) c ;
> >
> > Does D get compiled with "-I./include/c"?
>
> Yes.
>
> > Does D get compiled with "-I./include/b"?
>
> No. There's no mechanism how 'b' usage requirements will get into
> usage requirements of 'c's virtual targets.
>
> > Does D get compiled with "-I./include/a"?
>
> Ditto.
>
> > Example 2:
> >
> > lib a : $(ASrc) ;
> > lib b : $(BSrc) a : : : <library>a ;
> > lib c : $(CSrc) b : : : <library>b ;
> > exe D : $(DSrc) c ;
> >
> > Does D link to c?
>
> Yes.
>
> > Does D link to b?
>
> Yes, because "D" uses c and 'c' has <library>b in usage requirements.
>
> > Does D link to a?
>
> Yes. Because
> - D uses 'c'
> - usage requirements assigned to virtual targets generated
> from 'c' include <library>a -- those usage requirements are
> <library>b <library>a
>
> Hope this clarifies things. BTW, I think I see a possible cause for confusion.
> D uses 'c', and has <library>b added to build properties. It would seem that
> now D also uses 'b' and we need to add 'b''s usage requirements to build
> properties. And repeat the process.
>
> The way it works now it that D uses 'c' and gets both <library>b and
> library<a> immediately. IOW, if usage requirements propagated from a source
> have <library>b, they will also have <library>a.
>
> I'm waiting for your further comments.

Vladimir,

I like your answers, because that is what I would want...I would want
<include> properties NOT to be propagated further than the direct
dependents and of course <library> properties (meaning basically
"link-to" when used in Usage Requirements) MUST be propagated to
indirect dependents.

But my point is that I don't like that the semantics of Usage
Requirements are inconsistent...the propagation of <include> is
different than the propagation of <library>, but they look the same to
me. There seems to be no rule that applies in general to properties
appearing in Usage Requirements.

- You pointed out earlier that the rule "Usage Requirements are
exactly equivalent to Requirements in each direct dependent" is not
true.

- The rule "Usage Requirements appear in the Build Properties of
direct dependents" is not complete.

On the contrary, the semantics of Requirements seems clear. A
property in Requirements of a Target will appear in the Build
Properties for that Target.

Do you understand my complaint? Is it okay with you, from a design
and usability standpoint, that the semantics of how properties in
Usage Requirements apply and propagate to dependents is inconsistent?

--Ali

 


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk