-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#27] Add support for building universal lua-https modules. #29
Conversation
Awesome, thanks for doing this! |
The library extensions just got my attention.
LuaJIT happily loads Can anyone comment on this? |
|
What are the actual differences between the I can see that you are building devi as a dynamic library rather than a bundle for macOS. Is there a specific reason for this? Should the CMake target be switched to |
Unfortunately stock Lua made a decision to only look for the .so extension for dynamic libraries on macOS in its C module loader used for LÖVE adds its own C module loader that goes through love.filesystem, and that looks for .so for compatibility, as well as .dylib for correctness. Using .dylib for this library would still stop it from working outside of LÖVE with the default All that being said, within a single Linux or Windows platform you can have multiple dll/.so files for different architectures (x86 versus x64 etc), so putting everything in one folder and just relying on extensions wouldn't work with that regardless. |
I think that Lua devs are correct in using Shared libraries can be linked against and then loaded at runtime. Modules can not be linked against, only loaded at runtime. So in the context of Lua, building native libraries as a modules makes more sense, they are not linked against and loaded dynamically (however nothing stops one from loading a shared library at runtime without linking against it). In the context of macOS, shared libraries have the To conclude, on macOS:
As always, if you feel like I made a mistake, feel free to correct me. |
I'm building it as a dylib so it's trivial to convert to a framework for iOS... Re:
It's just built with a edit: used literally instead of actually for some reason 🤦 |
What
lua-https
modules on macOS (see Add artifact for Apple Silicon #27)How
Attached is a sample LÖVE app using the produced artifact to fetch the LÖVE website and print the response to the screen. (The app extension is named weird because GitHub won't allow uploading a
.love
file but obviously will run fine in LÖVE for macOS).https.love.zip
Result: