A malbox plugin template for C++.
- CMake 3.20+
- C++20 compiler (GCC 11+ or Clang 14+)
- Click Use this template on GitHub to create your own repository.
- Rename your plugin in
CMakeLists.txt(theproject()call andadd_executable()target) andplugin.toml(the[plugin]section). - Build:
cmake -B build
cmake --build build| File | Purpose |
|---|---|
CMakeLists.txt |
Build configuration, SDK download via FetchContent |
src/main.cpp |
Plugin implementation |
plugin.toml |
Plugin metadata, runtime config, and result declarations |
The SDK version is controlled by MALBOX_SDK_VERSION in CMakeLists.txt and corresponds to a malbox release tag (e.g. v0.1.0-alpha.2). To update, change the version string and rebuild. The SDK tarball is downloaded automatically via CMake FetchContent.
To target a different platform, set MALBOX_SDK_PLATFORM (default: linux-x64).
By default this template creates a guest plugin (runs inside the analysis VM). To create a host plugin (runs on the host machine):
- In
src/main.cpp:- Change
malbox::PluginType::Guesttomalbox::PluginType::Host - Change
malbox::run_guest_plugin(...)tomalbox::run_host_plugin(...)
- Change
- In
plugin.toml, changetype = "guest"totype = "host"