Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2007-03-21 07:12:36

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.

The most reliable way to declare targets outside of Jamfiles is

        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.

- Volodya

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at