Subclassing the compiler
Hi, The API reference for distutils tells how to get an instance of a new compiler sub-class with the following command: mycompiler = distutils.ccompiler.new_compiler(*plat=None*, *compiler=None*, *verbose=0*, *dry_run=0*, *force=0*) The API also specifies the commands to modify specific parameters within the returned compiler sub-class. However the API says nothing about how to actually "use" the new sub-class. In other words, how does one go about getting the following to work (or something similar)? python setup.py build where the build steps now use 'mycompiler' Thanks, -Simon
Hi,
You need to add your compiler into the ccompiler.compiler_class dict,
then specify the compiler type in the metadata in setup.py, with the
compiler option.
Regards
Tarek
On Sat, Feb 21, 2009 at 11:06 PM, Simon Wood
Hi,
The API reference for distutils tells how to get an instance of a new compiler sub-class with the following command:
mycompiler = distutils.ccompiler.new_compiler(plat=None, compiler=None, verbose=0, dry_run=0, force=0)
The API also specifies the commands to modify specific parameters within the returned compiler sub-class. However the API says nothing about how to actually "use" the new sub-class. In other words, how does one go about getting the following to work (or something similar)?
python setup.py build
where the build steps now use 'mycompiler'
Thanks,
-Simon
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
-- Tarek Ziadé | Association AfPy | www.afpy.org Blog FR | http://programmation-python.org Blog EN | http://tarekziade.wordpress.com/
Excellent!!! that did the trick.
On Sat, Feb 21, 2009 at 5:37 PM, Tarek Ziadé
Hi,
You need to add your compiler into the ccompiler.compiler_class dict, then specify the compiler type in the metadata in setup.py, with the compiler option.
Regards Tarek
Hi,
The API reference for distutils tells how to get an instance of a new compiler sub-class with the following command:
mycompiler = distutils.ccompiler.new_compiler(plat=None, compiler=None, verbose=0, dry_run=0, force=0)
The API also specifies the commands to modify specific parameters within
On Sat, Feb 21, 2009 at 11:06 PM, Simon Wood
wrote: the returned compiler sub-class. However the API says nothing about how to actually "use" the new sub-class. In other words, how does one go about getting the following to work (or something similar)?
python setup.py build
where the build steps now use 'mycompiler'
Thanks,
-Simon
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
-- Tarek Ziadé | Association AfPy | www.afpy.org Blog FR | http://programmation-python.org Blog EN | http://tarekziade.wordpress.com/
participants (2)
-
Simon Wood
-
Tarek Ziadé