diff --git a/CHANGELOG.md b/CHANGELOG.md index 6675ec5..59d9718 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ ### Fixed - Exported properties of tool scripts now appear in the inspector +- Yielding from coroutines now work in Web builds. + ⚠️ Warning: we're using `longjmp` because Web export templates do not ship with C++ exception support. + This works but **memory will leak**, since objects in the stack are not cleaned by the `longjmp` as they are when handling exceptions. ## [0.8.1](https://github.com/gilzoide/lua-gdextension/releases/tag/0.8.1) diff --git a/tools/lua.py b/tools/lua.py index 6bcd0fd..8025c3c 100644 --- a/tools/lua.py +++ b/tools/lua.py @@ -17,7 +17,9 @@ def generate(env): env.Append(CPPDEFINES="LUA_USE_ANDROID") if "32" in env["arch"]: env.Append(CPPDEFINES="LUA_USE_ANDROID_32") - elif env["platform"] != "web": + elif env["platform"] == "web": + env.Append(CPPDEFINES="LUA_USE_LONGJMP") + else: env.Append(CPPDEFINES="LUA_USE_POSIX") env.Append(CPPDEFINES=["SOL_USING_CXX_LUA=1"])