Define macro when invoking setup.py

Jason jason.heeris at gmail.com
Mon Nov 8 21:56:06 EST 2010


On Nov 9, 10:48 am, Christian Heimes <li... at cheimes.de> wrote:
> You were looking at the wrong manual. Readhttp://docs.python.org/distutils/setupscript.html#preprocessor-options
>
> Extension(...,
>           define_macros=[('NDEBUG', '1'),
>                          ('HAVE_STRFTIME', None)],
>           undef_macros=['HAVE_FOO', 'HAVE_BAR'])
>
> Note that define_macros requires a list of tuples each having two members.

But can they be selected or set from the command line, so I can do,
say, "setup.py build -DDEBUG=1"?

— Jason



More information about the Python-list mailing list