Boost logo

Boost-Build :

From: Daniel Einspanjer (deinspanjer_at_[hidden])
Date: 2006-02-28 18:22:26


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 ]
    ;

Obviously compilation of the fubar target fails because the properties
parameter is not passed in to get_extra_source. Unfortunately, I don't know
how to do so. :(

Most of the other ways I've learned to call rules inside targets
(<tag>@rule; <conditional>@rule) seem to just magically pass in the desired
parameters, and after a bit of searching, I can't even find code in the
boost-build system that shows me how they do it.. :/

I don't want to use conditionals because I don't want to force the developer
to have to modify the Jamfile whenever we add a customer. Creating the
fubar-acust.cpp file should be enough.

-- 
Daniel Einspanjer 

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