Boost logo

Boost-Build :

From: David Abrahams (dave_at_[hidden])
Date: 2007-03-21 10:48:19


on Wed Mar 21 2007, Vladimir Prus <ghost-AT-cs.msu.su> wrote:

> On Wednesday 21 March 2007 10:24, David Abrahams wrote:
>>
>> I'm looking at the implementation of main-target-rule and I see:
>>
>> # This rule may be only called from Jamfile, and therefore,
>> # CALLER_MODULE is Jamfile module, which is used to denote
>> # a project.
>> local project = [ project.current ] ;
>>
>> I sure hope that this rule doesn't rely on being called from a
>> Jamfile, as I need to declare targets in python.jam. I'm sure it's a
>> fairly common kind of need, too.
>
> That comment is out-of-date; as you see, CALLER_MODULE is
> not being used.

OK; will you update it?

> The most reliable way to declare targets outside of Jamfiles is
> this:
>
> project python ;
> .project = [ project.current ] ;
>
> rule whatever-rule-wants-to-declare-targets ( )
> {
> project.push-current $(.project) ;
>
> ... declare targets ...
>
> project.pop-current ;
> }
>
> This will always declare targets in the python project, even if you
> have multiple "using python" and between those "using" some
> other python is declared.

Thanks.

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