From b777c9f2e288aecba56d9142856e88ecac1369ef Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Sun, 10 May 2026 03:26:19 +0800 Subject: [PATCH] feat: add mcpp.toml for mcpp build support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wires libxpkg into the mcpp build system. Bumps version to 0.0.39 (continuing the existing 0.0.x series) and ships: - `mcpp.toml` — single `lib` target named `xpkg`, primary module at `src/xpkg.cppm` (matches the lib-root convention; tail segment of the package name `mcpplibs.xpkg` is `xpkg`). - `src/xpkg-lua-stdlib.cppm` — committed for mcpp builds. xmake regenerates this from `src/lua-stdlib/**/*.lua` via `before_build`, but mcpp doesn't have an equivalent codegen hook yet, so we ship the generated copy in the repo. Re-run the xmake target whenever the .lua sources change to keep both in sync. - depends on `mcpplibs.capi.lua = "0.0.3"` — the C++23 module wrapper for the Lua C API, indexed in mcpp-community/mcpp-index. Verified locally: `mcpp build` produces `target/.../bin/libxpkg.a` containing all five modules (xpkg, loader, index, executor, lua_stdlib) with the dependency on capi-lua + lua resolved transitively. --- mcpp.toml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 mcpp.toml diff --git a/mcpp.toml b/mcpp.toml new file mode 100644 index 0000000..ef3a0bc --- /dev/null +++ b/mcpp.toml @@ -0,0 +1,27 @@ +[package] +name = "mcpplibs.xpkg" +version = "0.0.39" +description = "C++23 reference implementation of the xpkg V1 spec — `import mcpplibs.xpkg;`" +license = "Apache-2.0" +repo = "https://github.com/openxlings/libxpkg" + +[targets.xpkg] +kind = "lib" + +# Library-root convention picks `src/xpkg.cppm` automatically. +# The package ships five separate modules under the `mcpplibs.xpkg.*` +# namespace (loader, index, executor, lua_stdlib) — they sit alongside +# the primary `mcpplibs.xpkg` and all roll into the single libxpkg.a. +# +# `src/xpkg-lua-stdlib.cppm` is generated from `src/lua-stdlib/**/*.lua` +# at xmake build time (see `before_build` in xmake.lua); the current +# generated copy is committed so mcpp builds work without invoking the +# xmake codegen path. Regenerate via `xmake build mcpplibs-xpkg-lua-stdlib` +# whenever the .lua sources change. + +[dependencies] +"mcpplibs.capi.lua" = "0.0.3" + +# `mcpp test` discovers tests/**/*.cpp + tests/**/*.cppm automatically. +[dev-dependencies] +gtest = "1.15.2"