Skip to content

DualHorizon/malbox-plugin-template-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

my-malbox-plugin

A malbox plugin template for C++.

Prerequisites

  • CMake 3.20+
  • C++20 compiler (GCC 11+ or Clang 14+)

Getting started

  1. Click Use this template on GitHub to create your own repository.
  2. Rename your plugin in CMakeLists.txt (the project() call and add_executable() target) and plugin.toml (the [plugin] section).
  3. Build:
cmake -B build
cmake --build build

Project structure

File Purpose
CMakeLists.txt Build configuration, SDK download via FetchContent
src/main.cpp Plugin implementation
plugin.toml Plugin metadata, runtime config, and result declarations

SDK version

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

Switching to a host plugin

By default this template creates a guest plugin (runs inside the analysis VM). To create a host plugin (runs on the host machine):

  1. In src/main.cpp:
    • Change malbox::PluginType::Guest to malbox::PluginType::Host
    • Change malbox::run_guest_plugin(...) to malbox::run_host_plugin(...)
  2. In plugin.toml, change type = "guest" to type = "host"

Further reading

About

Template repository for C++ malbox plugins

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors