This repository provides scripts and tools to compile the Lua runtime and generate Lua bytecode for embedding in the MultiReplace plugin (see notepadpp-multireplace
).
By precompiling Lua scripts, this setup enhances execution speed and security by embedding the bytecode directly into the plugin, removing the need for external Lua script files.
- Lua Compilation: Scripts to compile
lua.exe
andluac.exe
for generating Lua bytecode. - Automated Bytecode Generation: Converts Lua scripts (
.lua
) into bytecode (.luac
). - C++ Integration: Generates a
luaEmbedded.h
file containing the compiled bytecode for direct embedding into MultiReplace. - Cross-Platform Compatibility: Works with Windows using Visual Studio 2022.
Run the following command to compile the Lua interpreter and bytecode compiler:
./compile_lua.bat
Convert the initScript.lua
file into Lua bytecode:
./compile_luac.bat
Convert the compiled bytecode into a C++ header file:
cscript //nologo convert_luac.vbs
Alternatively, execute the full build process in one step:
./run_all.bat
The Lua directory can be set as a parameter when running run_all.bat
. If no path is specified, the default lua-5.4.6
directory is used.
Example usage:
./run_all.bat lua-5.4.6
initScript.luac
→ Compiled Lua bytecodeluaEmbedded.h
→ C++ header containing bytecode and source