Commits

Daniel Holth committed 97cc3a6

honor extension define_macros (#14843)

Comments (0)

Files changed (1)

Lib/packaging/command/build_ext.py

 
         # Next, compile the source code to object files.
 
-        # XXX not honouring 'define_macros' or 'undef_macros' -- the
-        # CCompiler API needs to change to accommodate this, and I
-        # want to do one thing at a time!
-
         # Two possible sources for extra compiler arguments:
         #   - 'extra_compile_args' in Extension object
         #   - CFLAGS environment variable (not particularly
         # command-line args.  Hence we combine them in order:
         extra_args = ext.extra_compile_args or []
 
-        macros = ext.define_macros[:]
+        macros = [(macro, 1) for macro in ext.define_macros]
         for undef in ext.undef_macros:
             macros.append((undef,))