|
24 | 24 | if sys.implementation.name == "cpython": |
25 | 25 | py_limited_api = True |
26 | 26 | options = {"bdist_wheel": {"py_limited_api": "cp311"}} |
| 27 | + define_macros = [("Py_LIMITED_API", 0x030B0000)] |
27 | 28 | else: |
28 | 29 | py_limited_api = False |
29 | 30 | options = {} |
| 31 | + define_macros = [] |
30 | 32 |
|
31 | 33 | # Monkey-patch Cython to not overwrite embedded signatures. |
32 | 34 | old_embed_signature = EmbedSignature._embed_signature |
@@ -148,7 +150,7 @@ def parse_cflags(raw_flags): |
148 | 150 | include_dirs=[f"{IMPORT_NAME}/filter"] + extension_extra["include_dirs"], |
149 | 151 | libraries=extension_extra["libraries"], |
150 | 152 | library_dirs=extension_extra["library_dirs"], |
151 | | - define_macros=[("Py_LIMITED_API", 0x030B0000)], |
| 153 | + define_macros=define_macros, |
152 | 154 | py_limited_api=py_limited_api, |
153 | 155 | ) |
154 | 156 |
|
@@ -194,7 +196,7 @@ def parse_cflags(raw_flags): |
194 | 196 | libraries=extension_extra["libraries"], |
195 | 197 | library_dirs=extension_extra["library_dirs"], |
196 | 198 | sources=[pyx_path], |
197 | | - define_macros=[("Py_LIMITED_API", 0x030B0000)], |
| 199 | + define_macros=define_macros, |
198 | 200 | py_limited_api=py_limited_api, |
199 | 201 | ), |
200 | 202 | compiler_directives=compiler_directives, |
|
0 commit comments