Build Module

Detailed instructions on building and packaging Golang language module.

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

Prerequisites

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

  • CMake (version 3.14 or later)
  • C++ Compiler (supporting C++20 or later)
    • Clang 15+
    • GCC 11+
    • MSVC 2022+
  • Plugify Core Library (built and available)

Steps to Build the C++ Language Module

Clone the Repository

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

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

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-cpp.

cmake --build . --target plugify-module-cpp

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-cpp.dll (Windows)
  • libplugify-module-cpp.so (Linux)
  • libplugify-module-cpp.dylib (macOS)

Integrating the C++ Language Module

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

  1. Copy the compiled module file to the modules directory of your Plugify installation.
  2. Ensure the Plugify core library is properly configured to load the module.
  3. Start Plugify, and the C++ Language Module will be automatically detected and loaded.

Troubleshooting

Common Issues

  1. Build Fails:
    • Ensure that you have the correct version of CMake and a compatible C++ compiler installed.
    • Verify that the Plugify core library is built and available.
  2. Module Not Loaded:
    • Ensure the module file is placed in the correct directory (modules).
    • Check the Plugify logs for any errors related to module loading.
  3. Missing Symbols:
    • Ensure that the module is built with the same compiler and C++ version as the Plugify core library.

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.