From f08327414272b96db66f5818be977f9beed7a528 Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Sun, 10 May 2026 03:14:04 +0800 Subject: [PATCH] feat: add mcpp.toml for mcpp build support Wires mcpplibs.capi.lua into the mcpp build system. The descriptor: - targets `capi-lua` (lib) at `src/capi/lua.cppm` (override the default lib-root convention which would look at `src/lua.cppm`), - depends on the upstream Lua 5.4.7 C library shipped via mcpp-community/mcpp-index (added 2026-05-09). mcpp 0.0.3's transitive walker propagates lua's headers into our compile rule, so the existing `extern "C" { #include ... }` in `src/capi/lua_headers.h` keeps working with no path tweaking. Verified locally: `mcpp build` is clean against a fresh `target/`. --- mcpp.toml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 mcpp.toml diff --git a/mcpp.toml b/mcpp.toml new file mode 100644 index 0000000..ee95c54 --- /dev/null +++ b/mcpp.toml @@ -0,0 +1,25 @@ +[package] +name = "mcpplibs.capi.lua" +version = "0.0.3" +description = "C++23 module wrapping the Lua 5.4 C API — `import mcpplibs.capi.lua;`" +license = "Apache-2.0" +repo = "https://github.com/mcpplibs/lua" + +[lib] +# The primary module interface lives at `src/capi/lua.cppm`. The default +# convention would look at `src/lua.cppm` (last segment of the package +# name), so override explicitly. +path = "src/capi/lua.cppm" + +[targets.capi-lua] +kind = "lib" + +# `lua` is the upstream Lua 5.4 C library shipped via mcpp-index. mcpp +# 0.0.3 propagates its headers (lua.h / lauxlib.h / lualib.h) into our +# compile rule via the transitive include-dir walk. +[dependencies] +lua = "5.4.7" + +# `mcpp test` discovers tests/main.cpp automatically. +[dev-dependencies] +gtest = "1.15.2"