From: Khassapov, Alex (Alex.Khassapov_at_[hidden])
Date: 2008-02-14 22:03:43
I found how to call rule from context of another module:
local mod = [ CALLER_MODULE ] ;
use-project $(id) : $(dir) ;
[mailto:boost-build-bounces_at_[hidden]] On Behalf Of Vladimir Prus
Sent: Wednesday, 13 February 2008 5:29 PM
To: Boost.Build developer's and user's list
Subject: Re: [Boost-build] how to use rules from module project-rules
(i.e.use-project) outside Jamfile
On Tuesday 12 February 2008 02:30:53 Khassapov, Alex wrote:
> Hi, I wonder how to use rules from module project-rules (i.e.
> use-project) outside Jamfile?
> I want to move some functions form Jamfiles to a separate utils.jam
> file, but these rules are not available there. Do I need to pass the
> current project from Jamfile to the rules in utils.jam somehow?
The way 'use-project' is implemented, it's rather integrated with
project loading. You can try project.use, see how load-used-projects
in project.jam uses that.
Generally, maybe rules in project-rules module need a current project,
and to call them, you need to know the current project somehow.
One way to know the current project is the project.current rule.
Note that it returns valid value only when a Jamfile is being read.
Jamfile is read, the return value is not meaningful.
Unsubscribe & other changes:
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