From: David Abrahams (dave_at_[hidden])
Date: 2003-03-31 10:59:32
Ali Azarbayejani <ali_at_[hidden]> writes:
> 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"?
>> > 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"?
>> > 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?
>> > 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.
> 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.
I think you're forgetting about template (and inline) libraries.
Maybe we need the library to specify how far to propagate include
> 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.
That might be another argument for having the originator of the
requirements be explicit about how far to propagate them.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
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