|
Boost-Build : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2002-10-09 10:12:44
David Abrahams wrote:
>>I'll use more concrete example. Boost.date_time requires that any code
>>that uses it set DATE_TIME_INLINE defines. This might be conveniently
>>implemented this way:
>>
>> lib date_time : ..... : use-requirements <define>DATE_TIME_INLINE ;
>>
>>if somebody writes:
>>
>> exe calendar : calendar.cpp @/boost/date_time/date_time ;
>>
>>then <define>DATE_TIME_INCLUDE will be applied when compiling calendar.cpp
>
>
> OK, that's what I expected. I think the name use-requirements is too
> close to sounding like "use these requirements", which is too close to
> "requirements", which means something completely different.
>
> How about "dependent-requirements"?
Maybe, or "exported-requirements" -- "dependent" may be confusing because reader
will have to recall what is "dependent" and what is "dependency"...
>
> And, what kind of dependents do these requirements get propagated to?
> All of them? Certain target types only?
All of them, I believe. I actually think that we should export to dependents only
free properties, as otherwise everything will become a mess. It means that if
exported requirements make no sense to certain dependent, it will just ignore them.
> Direct and indirect, or just direct dependents? What about a test
> target that depends on the exe which depends on the lib?
I think to indirect also. For example, <find-library>, which will be used to
refer to standard library, should be propagated to indirect dependents.
exe a : a.cpp lib1 ;
lib lib1 : lib1.cpp : : exported-requirements <library>lib2 ;
lib lib2 : lib2.cpp : : exported-requirements <find-library>pcre ;
Here, a uses library "lib1", which uses another library, "lib2" in it's
implementation. Therefore, "lib2" must used when linking "a". However, when
linking "lib2", you also need "-lpcre". Thus, <find-library>pcre must be propagated
to indirect dependents. There's no problem if that dependent is test target: it will
just ignore <find-library> property.
> P.S. The example in your previous message showed an exe with
> use-requirements, which was doubly confusing.
Ah.. sorry!
- Volodya
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