slua

Static lua compiler - Compile Lua code into C code.

OTHER License

Stars
62

README for slua

=== Requires ===

=== Compile ===

  • mkdir build
  • cd build
    for Release build:
  • cmake .. -DCMAKE_BUILD_TYPE=Release
    for Debug build:
  • cmake .. -DCMAKE_BUILD_TYPE=Debug
  • make

=== Install ===

  • make install

=== Patches to lua/src ===

=== Programs ===

  • slua: This command can be used to run Lua script. It doesn't have JIT support!
  • sluac: This command compiles Lua scripts into C code which calls lua vm ops functions.
  • slua-compiler: This is a bash script that wraps sluac to compile Lua scripts into standalone executables or loadable modules.

=== Libraries === -- static & dynamic libraries for linking into host app.

  • libslua_static.a & libslua.so

-- Used for compling Lua scripts to standalone executables.

  • liblua_main.a

=== Using slua === 'sluac' alone can only compile Lua scripts to Lua bytecode or C code. A wrapper script called 'slua-compiler' is provided that wraps 'sluac' and gcc.

Compile standalone Lua script: slua-compiler script.lua outputs: ./script

Compile Lua script as a module: slua-compiler -lua-module script.lua outputs: ./script.so