Repository navigation
Values for define_macros=
#4804
Replies: 1 comment
|
There is a distinction between the two APIs in the documentation: For your GCC-specific ordering requirement, a documented alternative is to keep both flags together in Extension(
"your_module",
["your_module.c"],
extra_compile_args=["-U_FORTIFY_SOURCE", "-D_FORTIFY_SOURCE=2"],
)Setuptools puts those extra arguments after its normal compiler options, and GCC processes I checked setuptools 84.0.0: its preprocessing helper still maps |
Uh oh!
There was an error while loading. Please reload this page.
For
Extension(defines_macros=[...], ...)thedefines_macroslist is documented as accepting entries of the form('NAME','value')and('NAME',None), which with GCC yield-DNAME=valueand-DNAMErespectively. I find that a third form('NAME',)is accepted, yielding-UNAME.This third form is redundant to the
undef_macros=[...]list, with the added benefit of control over relative ordering, which is important as I have a situation where I want to pass-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2in this order to override the default value of that builtin macro.Is this third form considered supported? If not, can it be?
All reactions