linux doesn't even use exe files, but if you want to be able to run a lua script, just chmod it to allow execution and add a shebang to your lua interpreter, then it will run as if it was any other script
Is there much to cross compile for lua though ? Running a lua script is literally a single command line, almost the same for any plate-form. Or do you mean shipping the lua interpreter along one's script ?
Lua scripts are OS portable. They run in Windows the same as they run on Linux. Just give your friends your scripts, lua.exe for Windows and a bat file to start it off
My shill comment, my lua-dist tool. It will pop out a .sh for Linux, a .bat for Windows, and an .app for OSX ... and if you have appimagetool installed, an .AppImage for Linux as well. It is also bundled with LuaJIT-openresty (compiled with 5.2 compatibility enabled) for each respective platform.
15
u/Bright-Historian-216 May 21 '25
linux doesn't even use exe files, but if you want to be able to run a lua script, just chmod it to allow execution and add a shebang to your lua interpreter, then it will run as if it was any other script
2
u/Cootshk May 22 '25
Use luamake (https://github.com/actboy168/luamake)
Or make a c/c++ project and just call lua_loadfile and then cross compile
2
u/SkyyySi May 22 '25
While I would highly recommend that you just tell your friends to install Lua, if you must do it this way: You need to bundle an interpreter with your scripts. You can find some tools in this thread: https://www.reddit.com/r/lua/comments/168bw5c/how_can_i_convert_a_lua_to_exe/
2
u/bidaowallet May 24 '25
luaC in windows
1
u/negativedimension May 30 '25
My shill comment, my lua-dist tool. It will pop out a
.shfor Linux, a.batfor Windows, and an.appfor OSX ... and if you haveappimagetoolinstalled, an.AppImagefor Linux as well. It is also bundled with LuaJIT-openresty (compiled with 5.2 compatibility enabled) for each respective platform.-1
u/Interesting_Cut_6401 May 21 '25
Maybe wine