Define macro when invoking setup.py

Jason jason.heeris at gmail.com
Mon Nov 8 21:09:39 EST 2010


I'd like to be able switch between building my C extension with a
certain preprocessor macro defined or not defined. I'm using the
rudimentary distutils setup.py example given here:

http://docs.python.org/extending/building.html

Is there a command line option that distutils.core.setup() will
interpret for me, like the "-D" option for gcc? Or do I need to do
something more complicated? (I had a brief look at the
distutils.command.build_* docs... but they're pretty sparse.)



More information about the Python-list mailing list