|
Boost-Build : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-03-01 02:57:33
On Wednesday 01 March 2006 02:22, Daniel Einspanjer wrote:
> I'd like to be able to declare the sources of a target like this:
>
> rule get_extra_source ( properties )
> {
> local cust_name = [ $(properties).get <customer> ] ;
> return [ glob fubar-$(cust_name).cpp ] ;
> }
> exe fubar
>
> : # sources
>
> foo.cpp
> bar.cpp
> [ get_extra_source ]
> ;
Just indirect conditional requirements together with the <source> feature:
rule get_extra_source ( properties * )
{
local cust_name = [ feature.get-values <customer> : $(properties) ] ;
local s = [ glob fubar-$(cust_name).cpp ] ;
return <source>$(s) ;
}
exe foobar : foo.cpp : <conditional>@get_extra_source ;
You can find a simpler example attached.
Aren't indirect conditional requirements cool?
HTH,
Volodya
*****************************************************************************
** **
** WARNING: This email contains an attachment of a very suspicious type. **
** You are urged NOT to open this attachment unless you are absolutely **
** sure it is legitmate. Opening this attachment may cause irreparable **
** damage to your computer and your files. If you have any questions **
** about the validity of this message, PLEASE SEEK HELP BEFORE OPENING IT. **
** **
** This warning was added by the IU Computer Science Dept. mail scanner. **
*****************************************************************************
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