Browse docs

Compiling to an Executable

lde compile produces a standalone native executable that bundles your Lua code, all dependencies, and the LuaJIT runtime into a single binary. Users need no Lua installation to run it.

How it works

lde builds and installs your dependencies, then walks ./target/ collecting every .lua file and every native shared library (.so / .dll / .dylib). Lua files are embedded as preloaded modules. Native libraries are packed into the binary and extracted to a temporary directory at runtime, then resolved via package.preload. The binary includes the LDE runtime (LuaJIT) — it is not compatible with standard Lua. See Requirements for compiler prerequisites.

Basic usage

lde compile

Outputs <name> (or <name>.exe on Windows) in your project root.

Custom output path

lde compile --outfile dist/myapp

On Windows .exe is appended automatically if not already present.

Native modules

Shared libraries built by a build.lua script are automatically included. See C Module Support for how to produce them.

On Linux the binary exports LuaJIT symbols so native modules don’t require a separate Lua installation. On Windows you may need to bundle a Lua shared library alongside your executable.