From 252fc29c18d25a81e1644f2ae003c71617a2fb09 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 10 Jul 2024 00:48:10 +0100 Subject: [PATCH] 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. --- raylib/build.py | 7 +++++-- version.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/raylib/build.py b/raylib/build.py index 36aa112..ebe6d99 100644 --- a/raylib/build.py +++ b/raylib/build.py @@ -164,16 +164,17 @@ def build_unix(): '-framework', 'IOKit', '-framework', 'CoreFoundation', '-framework', 'CoreVideo'] libraries = [] - extra_compile_args = ["-Wno-error=incompatible-function-pointer-types"] + extra_compile_args = ["-Wno-error=incompatible-function-pointer-types", "-D_CFFI_NO_LIMITED_API"] else: #platform.system() == "Linux": print("BUILDING FOR LINUX") extra_link_args = get_lib_flags() + [ '-lm', '-lpthread', '-lGL', '-lrt', '-lm', '-ldl', '-lX11', '-lpthread', '-latomic'] - extra_compile_args = ["-Wno-incompatible-pointer-types"] + extra_compile_args = ["-Wno-incompatible-pointer-types", "-D_CFFI_NO_LIMITED_API"] libraries = ['GL', 'm', 'pthread', 'dl', 'rt', 'X11', 'atomic'] ffibuilder.set_source("raylib._raylib_cffi", ffi_includes, + py_limited_api=False, include_dirs=[get_the_include_path()], extra_link_args=extra_link_args, extra_compile_args=extra_compile_args, @@ -200,6 +201,8 @@ def build_windows(): #include "physac.h" """, extra_link_args=['/NODEFAULTLIB:MSVCRTD'], + extra_compile_args="/D_CFFI_NO_LIMITED_API", + py_limited_api=False, libraries=['raylib', 'gdi32', 'shell32', 'user32', 'OpenGL32', 'winmm'], include_dirs=['D:\\a\\raylib-python-cffi\\raylib-python-cffi\\raylib-c\\src', 'D:\\a\\raylib-python-cffi\\raylib-python-cffi\\raylib-c\\src\\external\\glfw\\include', diff --git a/version.py b/version.py index 9badb2e..ef94f4f 100644 --- a/version.py +++ b/version.py @@ -1 +1 @@ -__version__ = "5.0.0.3" \ No newline at end of file +__version__ = "5.0.0.4.dev0" \ No newline at end of file