Skip to content

About

Official mcpp build plugins: rule packages under mcpp.rules.*, build-time utilities under mcpp.tools.*, one package selected by features

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

51 Commits

Folders and files

Repository files navigation

mcpp-plugins

The build plugins the mcpp project maintains, published as one package, mcpp:plugins. mcpp is a general engine with a framework for build plugins; plugins come from this package, from third parties, or from the project itself, and build.mcpp is where a project uses them. A consumer selects the members it needs through features, imports each one from build.mcpp under the module name the member declares, and configures it there.

[build-dependencies.mcpp]
plugins = { version = "0.21.0", features = ["rules-spirv"], host-module = true }
// build.mcpp
import std;
import mcpp;
import mcpp.rules.spirv;

int main() {
    mcpp::rules::spirv::options opt;
    opt.includes = { "shaders" };
    return mcpp::rules::spirv::compile(opt) ? 0 : 1;
}

The edge is a [build-dependencies] entry, not a [dependencies] entry: host-module = true states which build-time product is wanted, and the section states that the package does not reach the target. A rule's library is never linked into the artifact (mcpp docs/05 §2.6.1).

Naming

family module answers
rules mcpp.rules.<x> how one kind of translation unit is compiled by a compiler mcpp does not drive
tools mcpp.tools.<x> what the build program does itself (see tools/README.md)
dist mcpp.dist.<x> what comes out of the link, and in what form a user installs it
deps mcpp.deps.<x> where a library comes from
identity mcpp.plugins the lib root, compiled before every member; it states the collection's version

The second segments core, plugins, deps, rules, dist and tools of mcpp. belong to this package and the engine; a third-party plugin names its modules mcpp.<its namespace>.* (docs/plugin-development.md). The full account of the families, and of how the engine routes a file to a rule, is in docs/engine-and-rules.md. Where the tool a member runs comes from -- what a project can name, what a plugin must declare for naming it to avoid a download, and the scenarios on both sides -- is in docs/tool-sources.md.

Members

From 0.21.0 the package as a whole needs mcpp 2026.10.30.1 ([package] mcpp), which writes the configuration's contract that deps-cmake compiles a cross build from (0.20.0 needed 2026.10.27.1, whose protocol 17 states a platform's fields and whose mcpp pack writes mcpp-package.json beside every staged tree; 0.19.0 needed 2026.10.1.3, whose protocol 15 states where each tool and payload comes from); the column states the release each member's behaviour first needed.

Cross CMake subprojects that link executables or shared libraries require mcpp 2026.11.7.1 or later; cross configuration requires CMake 3.19 or later.

feature module mcpp floor what it does doc
rules-ascendc mcpp.rules.ascendc 2026.10.1.3 Compiles Ascend C (*.asc) with BiSheng in mixed mode, so the object joins the ordinary link. rules
rules-cuda mcpp.rules.cuda 2026.10.1.3 Compiles CUDA (*.cu) through clang with an LLVM toolchain or nvcc with a GCC one. rules
rules-hip mcpp.rules.hip 2026.10.1.3 Compiles HIP (*.hip) with the project's clang on the NVIDIA platform. rules
rules-metal mcpp.rules.metal 2026.9.8.1 Compiles .metal shaders into Metal libraries with the host's Xcode and deploys them beside the program. rules
rules-qt mcpp.rules.qt 2026.10.1.3 Runs moc, uic, rcc and Qt's Linguist tools as actions, links the Qt modules and places their runtime. rules-qt
rules-slang mcpp.rules.slang 2026.10.1.3 Compiles Slang (*.slang) and embeds or places the result. rules
rules-spirv mcpp.rules.spirv 2026.10.1.3 Compiles GLSL and HLSL shader stages to SPIR-V and embeds or places the result. rules
rules-swift mcpp.rules.swift 2026.9.8.1 Compiles a package's .swift sources into one module the C and C++ sources call. rules
rules-sycl mcpp.rules.sycl 2026.10.1.3 Compiles SYCL (*.sycl) with DPC++. rules
tools-embed mcpp.tools.embed 2026.9.5.4 Writes a data file into a header the program compiles in. tools-embed
tools-island mcpp.tools.island 2026.9.7.1 Generates the extern "C" boundary and the C++ module of a code island. tools-island
dist-appimage mcpp.dist.appimage 2026.10.1.3 Turns the tree mcpp pack stages into an AppImage (Linux). dist
dist-wix mcpp.dist.wix 2026.10.1.3 Builds an MSI of the staged tree, and a Burn bundle chaining it (Windows). dist
dist-apple mcpp.dist.apple 2026.9.14.2 Lays out a macOS or iOS application bundle, signs it and writes a disk image. dist-apple
dist-web mcpp.dist.web 2026.9.13.1 Copies a wasm32-emscripten program and its files into a web directory with an index.html. dist
dist-apk mcpp.dist.apk 2026.10.1.3 Packs the native closure into a signed APK or App Bundle, with Java, Kotlin and Maven libraries. dist-apk
deps-vcpkg mcpp.deps.vcpkg 2026.10.1.3 Installs a vcpkg.json manifest as an action with the toolset mcpp resolved, and maps the prefix into the build. deps
deps-cmake mcpp.deps.cmake 2026.10.1.3; a cross build 2026.10.30.1 Builds and installs a CMake subproject as an action with Ninja and the toolset mcpp resolved -- for another target, the compilers and words of the engine's contract -- keeps the installation for any build with the same key, and maps the prefix into the build. deps
deps-archive mcpp.deps.archive 2026.10.1.3 Extracts a zip archive the project keeps and places its tree beside the program. deps

Some features add a sub-capability to a member: dist-apk-kotlin and dist-apk-maven (Kotlin sources, a Maven graph), and deps, which the deps members imply.

The general library (0.17.0). plugins-core gives a build program mcpp.plugins.declare, mcpp.plugins.toolset (the resolved toolchain, translated for a foreign build system), mcpp.plugins.fs (deterministic file generation and placement) and mcpp.plugins.tool (where a tool a member runs comes from, one order for every member, 0.19.0). Every member implies it; a build program that uses only these modules, and a third-party plugin built on them, name it on the dependency edge. plugins-testing adds mcpp.plugins.testing, which runs a plugin function against a stated build context and compares what it declared. plugins-toolchain adds mcpp.plugins.toolchain, the builders a root build program states the build toolchain with (0.19.0). plugins-platform adds mcpp.plugins.platform, what a platform's plugin and a package format's provider state -- the link, the artifacts' names, the seal, where the runner runs, and provide_format -- and mcpp.plugins reads a staged package's mcpp-package.json (mcpp::plugins::package), 0.20.0, mcpp 2026.10.27.1 (plugin-development). The first three need mcpp 2026.10.1.3. surface, the name of plugins-core before 0.17.0, is kept until 2027-03-28. A feature states a mechanism and the tools that mechanism runs; the libraries and SDKs a program links are the project's declaration (0.15.0 removed rules-qt-xim*; see rules-qt).

mcpp.plugins.accel reads complete implementation-owned target requests; mcpp.plugins.progress enables optional action telemetry. Worker programs can select plugins-progress for mcpp.plugins.progress.writer, the atomic snapshot writer. See plugin-development.

Layout

mcpp.toml            the package: one feature per member
src/plugins.cppm     export module mcpp.plugins;  the version, mcpp::plugins::surface
                     (the declarations a consumer names), mcpp::plugins::xml and
                     mcpp::plugins::package (a staged package's metadata)
src/declare.cppm,    the general library for build programs (`plugins-core`):
src/toolset.cppm,    mcpp.plugins.declare, mcpp.plugins.toolset, mcpp.plugins.fs
src/fs.cppm
src/testing.cppm     mcpp.plugins.testing (`plugins-testing`)
src/platform.cppm    mcpp.plugins.platform (`plugins-platform`)
src/compat/, deps/compat/
                     compatibility units, each retired on the date its header states
rules/<x>.cppm       export module mcpp.rules.<x>;
tools/<x>.cppm       export module mcpp.tools.<x>;
dist/<x>.cppm        export module mcpp.dist.<x>;
deps/<x>.cppm        export module mcpp.deps.<x>;  deps/deps.cppm is shared
tests/<consumer>/    one project per member, built by CI with the pinned mcpp
docs/                one page per member or group of members

Adding a member

A member is one module file, one feature in mcpp.toml, a consumer under tests/ that CI builds and asserts on, a row in the table above with its mcpp floor, and a version bump. Its code is the C++23 that GCC with libstdc++, clang with libc++ and an editor's clangd with libstdc++ all accept, and CI builds or reads every fixture under each of the three (docs/plugin-development.md). The conventions a member follows -- the same for a third-party or a project's own plugin -- are in docs/plugin-development.md; the division between what the engine owns and what the member owns is in docs/engine-and-rules.md.

Releases

A tag v<version> publishes the source archive; the index descriptor (mcpp-index/pkgs/m/mcpp.plugins.lua) names the GitHub archive and its GitCode mirror with one sha256.

About

Official mcpp build plugins: rule packages under mcpp.rules.*, build-time utilities under mcpp.tools.*, one package selected by features

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages