mlua icon indicating copy to clipboard operation
mlua copied to clipboard

iOS support

Open dotellie opened this issue 4 years ago • 1 comments

I'm currently making a little cross-platform game as a side project where I want to use Lua but realized that unfortunately mlua doesn't support iOS yet. Did some digging myself and managed to get it working but it's very hacky. If someone knows how to actually package this properly into a PR and get iOS support in mlua I would extremely appreciate it! 😊

What I did

(all of this is concerning the lua-src crate, not the mlua crate itself)

  • Added iOS as a valid build target by "cheating"
    _ if target.contains("apple-ios") => {}
    
    • This should also preferably contain tvOS and potentially watchOS although you would have to be quite crazy to want to run Rust + Lua on your smartwatch 😆
  • Disabled system in luaconf.h using what I found here: http://lua-users.org/lists/lua-l/2017-09/msg00242.html
    • See I said this was quite hacky 😅 This solution works, but I can't for my life imagine that the actual Lua source would have to be modified for iOS to work properly. Most likely, there is something we can configure in the build script to get this going properly, I just don't personally know what.

dotellie avatar Dec 29 '21 11:12 dotellie

Thanks! I'll take a look and definitely consider adding iOS support.

khvzak avatar Dec 31 '21 15:12 khvzak

Seems Luau is the best option to use in iOS

khvzak avatar Dec 21 '22 15:12 khvzak