|
Boost-Build : |
From: Hassan Mehmet (hassan_mehmet_at_[hidden])
Date: 2006-12-19 09:09:26
Hi
Is there any simple overview / examples of how rules, actions and generators are all related?
In particular I'm struggling to understand if I need to create a rule, an action, a standard generator or my own generator subclass. I have not really been able to figure this out from the manual.
The problem is:
I have taken over some Jamfiles written by someone else. In it they have created an action to generate CPP files from SWIG files which are then used to generate a python-extension. The action to create the CPP from SWIG follows the verbatim example in the manual and is fairly easy to follow.
import type ;
import generators ;
type.register SWIG : i ;
actions swig-action { swig -c++ -python -Iinclude -o $(<) $(>) }
generators.register-standard swig-swig-action : SWIG : CPP ;
The build system now knows how to convert SWIG files to CPP which are then used to create the python extension library.
Now I want to generate a C# version. This also creates CPP files from SWIG but has different arguments. So I need an action like
actions swig-csharp { swig -c++ -csharp -Iinclude -o $(<) $(>) }
The problem now is I (obviously) cannot use the python-extension rule. So I assume I need to create my own rule ? How do I get this new rule to call the swig-csharp action. Or do I need to do something more complicated?
Regards
Hassan
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