|
Boost-Build : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-01-20 09:36:00
I was thinking about reuse of toolset definitions when declaring other
toolsets. The conclusion is that it's probably quite simple. Basically,
toolset can:
- change some variables (for example Kylix can redefine
COMPILER_NAME and LINKER_NAME, provided base borland toolset uses those),
- add some flags
- rewrite some rules
I think that V2 heavily uses generators, this is the right unit of
inheritance. We have provide some means to inherit generator. For example,
borland toolset contains:
generators.register-compiler borland.compile : CPP : OBJ : <toolset>borland ;
Toolset for kylix can contain:
toolset.inherit-generator borland.compile ;
This would create new generator "kylix.compile" which will be equal to
"borland.compile" except that required properties will contain <toolset>kylix
instead of <toolset>borland.
All flags relevant to this generator will be inherited too. Lastly, all rules
will be imported. E.g if borland.jam had:
actions compile
{
$(COMPILER_NAME) ....
}
then the kylix module will get its own copy of this rule, which will use the
COMPILER_NAME variable defined in the kylix module.
I guess there should also be a convenience rule, which will inherit all
generators from other module.
Does it sound reasonable?
- Volodya
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