Build Module

Detailed instructions on building and packaging Lua language module.

The Lua Language Module (plugify-module-lua) is a core component of Plugify that enables the creation and management of Lua plugins. This guide will walk you through the process of building the module from source.

Prerequisites

Before building the Lua Language Module, ensure you have the following installed:

  • CMake (version 3.14 or later)
  • C++ Compiler with C++23 support. Release builds use:
    • GCC 14 (Linux)
    • MSVC 2022 (Windows)
    • Apple Clang (macOS)
  • Git: the Plugify core is a submodule of the repository, so clone it with --recursive. A separate build of the core is not needed.

Steps to Build the Lua Language Module

Clone the Repository

Clone the plugify-module-lua repository to your local machine:

git clone https://github.com/untrustedmodders/plugify-module-lua.git --recursive
cd plugify-module-lua

Generate Build Files

Create a build directory and generate the build files using CMake:

mkdir build
cd build
cmake ..

Build the Module

Build the module using the following command. The target name is plugify-module-lua.

cmake --build . --target plugify-module-lua

Verify the Build

Once the build process is complete, the compiled module will be located in the build directory. Verify the build by checking for the following files:

  • plugify-module-lua.dll (Windows)
  • libplugify-module-lua.so (Linux)
  • libplugify-module-lua.dylib (macOS)

Integrating the Lua Language Module

After building the module, you can integrate it into your Plugify setup:

  1. Install a released package of the module as described in Installation. It brings the manifest and the runtime files the module needs.
  2. Replace the library in its bin folder with the one from your build folder.
  3. Run plg load and check that plg modules lists the module.

Troubleshooting

Common Issues

  1. Build Fails:
    • Ensure that you have the correct version of CMake and a compatible C++ compiler installed.
    • Verify that the submodules are cloned: git submodule update --init --recursive.
  2. Module Not Loaded:
    • Ensure the module file is placed in the correct directory (envs).
    • Check the Plugify logs for any errors related to module loading.
  3. Missing Symbols:
    • Build the module from a release tag, so that the bundled core matches the Plugify version you run.

Advanced Configuration

For more detailed instructions on building Language Modules (e.g., configuring CMake options, enabling tests, or building documentation), refer to the Building Plugify guide. The process is similar but contains much more info.