A C-based compiler that converts Lua source files into standalone Windows executable files.
I published this repository (which still doesn't work properly) for you to fix it, improve it, and turn it into the best Lua compiler on the market 😁
- Compile Lua scripts to standalone Windows EXE files
- Embed Lua runtime directly in the executable
- Simple command-line interface
- Support for Lua 5.1, 5.2, 5.3, and 5.4
- Cross-platform compilation
- Minimal dependencies
- GCC or Clang compiler
- Make or CMake
- Windows SDK (for Windows development)
mkdir build
cd build
cmake ..
makeOr using Visual Studio:
mkdir build
cd build
cmake .. -G "Visual Studio 16 2019"
cmake --build . --config Releasewinexelua input.lua -o output.exe-o, --output <file>: Output executable filename-i, --icon <file>: Custom application icon (ICO format)-v, --version <ver>: Application version string-c, --console: Enable console window-h, --help: Display help message
winexelua hello.lua -o hello.exe -cThis will compile hello.lua to hello.exe with a console window.
.
├── CMakeLists.txt # CMake build configuration
├── README.md # This file
├── src/
│ ├── main.c # Main entry point
│ ├── compiler.c # Compiler logic
│ ├── embedder.c # Executable embedder
│ └── utils.c # Utility functions
├── include/
│ ├── compiler.h # Compiler header
│ ├── embedder.h # Embedder header
│ └── utils.h # Utilities header
├── lua/
│ ├── lua.h # Lua header
│ ├── lauxlib.h # Lua auxiliary library
│ └── lualib.h # Lua standard library
└── examples/
├── hello.lua # Hello world example
└── calculator.lua # Simple calculator example
- Parsing: Reads the Lua source file
- Embedding: Embeds the Lua code as a resource in a template executable
- Compilation: Compiles the template with embedded code
- Linking: Links against Lua runtime library
- Output: Produces standalone EXE file
MIT License