Skip to content

feat: add mcpp.toml for mcpp build support#16

Merged
Sunrisepeak merged 1 commit into
mainfrom
feat/mcpp-build-support
May 9, 2026
Merged

feat: add mcpp.toml for mcpp build support#16
Sunrisepeak merged 1 commit into
mainfrom
feat/mcpp-build-support

Conversation

@Sunrisepeak
Copy link
Copy Markdown
Member

Summary

Wires libxpkg into the mcpp build system on top of the existing xmake support.

  • mcpp.toml — single lib target named xpkg, primary module at src/xpkg.cppm (matches the lib-root convention since the package's tail segment is xpkg).
  • Depends on mcpplibs.capi.lua = "0.0.3", indexed in mcpp-index.

mcpp 0.0.3's transitive walker pulls lua (Lua 5.4 C library) along the chain capi-lua → lua, so the import mcpplibs.capi.lua; calls inside xpkg-loader.cppm / xpkg-executor.cppm resolve transparently.

lua-stdlib codegen note

xmake regenerates src/xpkg-lua-stdlib.cppm from src/lua-stdlib/**/*.lua via before_build. mcpp doesn't have an equivalent pre-build hook yet, so the already-tracked generated copy in src/xpkg-lua-stdlib.cppm is what mcpp builds against. Re-run xmake build mcpplibs-xpkg-lua-stdlib after editing the .lua sources to keep both up to date.

Test plan

  • mcpp build produces target/.../bin/libxpkg.a containing all five modules with deps resolved transitively
  • CI green
  • After merge: tag v0.0.39 so the tarball flows into mcpp-index

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.
@Sunrisepeak Sunrisepeak merged commit 45f877e into main May 9, 2026
3 checks passed
@Sunrisepeak Sunrisepeak deleted the feat/mcpp-build-support branch May 9, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant