Boost logo

Boost-Build :

From: Rene Rivera (grafik666_at_[hidden])
Date: 2002-02-26 10:59:28


On 2002-02-26 at 12:08 PM, witt_at_[hidden] (Thomas Witt) wrote:

>Hi,
>
>The attached patch introduces a new rule template that can be used to
>conveniently define project wide requirements. Furthermore
>a change to the with-command-file rule is made to allow for
>additional prefix string that contains non-sources. I need this to circumvent
>cmdline restrictions with long libpathes on windows.

Don't know about the with-command-file stuff, but defining project wide
requirements is already supported by the use of "variant". And is the main
reason I extented the "variant" rule. Your example could be written as such
instead...

>Here is an example of template usage.
>
>#
># Defining requirements template
>#
>template TplBase
> :
> :
> # requirements
> <include>../myinclude
> <define>TEMPLATE
> # build not covered so far.
> ;

variant TplBase
:
<include>../myinclude
<define>TEMPLATE
;

>#
># Defining another requirements template
># that inherits requirements
>#
>template TplDerived
> :
> # only <template> dependencies go here
> <template>TplBase
> :
> <include>../anotherinclude
> <define>DERIVED_TEMPLATE
> ;

variant TplDerived : TplBase
:
<include>../anotherinclude
<define>DERIVED_TEMPLATE
;

>#
># Exe that uses requirements from TplDerived
>#
>exe MyExe
> :
> main.cpp
> <template>TplDerived
> :
> :
> debug
> ;

variant my-debug : TplDerived : ;
variant my-release : TplDerived : ;
exe MyExe
:
main.cpp
:
:
my-debug
;

>I am using template in two projects and it reduces the maintenance work
>by at least an order of magnitude. Currently template covers only
>requirements but I think it can be extended to cover build settings to. The
>need for requirements was just more pressing :-). If this goes in I will
>happily update the documentation.

Same reason I did the variant extension :-) It makes it a brease to control
the settings of the 20 or so disparate targets in my project.

I'm not sure about your idea of also "globally" specifying the build settings.
Could explain how that might work? Any advantages over the current system?

-- grafik - Don't Assume Anything
-- rrivera_at_[hidden] - grafik_at_[hidden]
-- 102708583_at_icq - Grafik666_at_AIM - Grafik_at_[hidden]

 


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