Skip to content

Commit 252fc29

Browse files
Disable use of Py_LIMITED_API. Py_LIMITED_API already didn't work reliably - we had to do builds for every Python version to ensure they would all work. So removing it shouldn't cause problems, and it may increase performance and may allow running on free-threading Python.
1 parent 7af2922 commit 252fc29

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

raylib/build.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,17 @@ def build_unix():
164164
'-framework', 'IOKit', '-framework', 'CoreFoundation', '-framework',
165165
'CoreVideo']
166166
libraries = []
167-
extra_compile_args = ["-Wno-error=incompatible-function-pointer-types"]
167+
extra_compile_args = ["-Wno-error=incompatible-function-pointer-types", "-D_CFFI_NO_LIMITED_API"]
168168
else: #platform.system() == "Linux":
169169
print("BUILDING FOR LINUX")
170170
extra_link_args = get_lib_flags() + [ '-lm', '-lpthread', '-lGL',
171171
'-lrt', '-lm', '-ldl', '-lX11', '-lpthread', '-latomic']
172-
extra_compile_args = ["-Wno-incompatible-pointer-types"]
172+
extra_compile_args = ["-Wno-incompatible-pointer-types", "-D_CFFI_NO_LIMITED_API"]
173173
libraries = ['GL', 'm', 'pthread', 'dl', 'rt', 'X11', 'atomic']
174174

175175
ffibuilder.set_source("raylib._raylib_cffi",
176176
ffi_includes,
177+
py_limited_api=False,
177178
include_dirs=[get_the_include_path()],
178179
extra_link_args=extra_link_args,
179180
extra_compile_args=extra_compile_args,
@@ -200,6 +201,8 @@ def build_windows():
200201
#include "physac.h"
201202
""",
202203
extra_link_args=['/NODEFAULTLIB:MSVCRTD'],
204+
extra_compile_args="/D_CFFI_NO_LIMITED_API",
205+
py_limited_api=False,
203206
libraries=['raylib', 'gdi32', 'shell32', 'user32', 'OpenGL32', 'winmm'],
204207
include_dirs=['D:\\a\\raylib-python-cffi\\raylib-python-cffi\\raylib-c\\src',
205208
'D:\\a\\raylib-python-cffi\\raylib-python-cffi\\raylib-c\\src\\external\\glfw\\include',

version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "5.0.0.3"
1+
__version__ = "5.0.0.4.dev0"

0 commit comments

Comments
 (0)