From d46a01d4b93794ebb449a6769912a2c2517f903a Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Sat, 9 May 2026 17:34:59 +0800 Subject: [PATCH] feat: add mcpp build support (mcpp.toml) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the mcpp 0.0.2+ manifest alongside the existing xmake.lua. Both build paths coexist; consumers of either ecosystem can pick. Manifest highlights: * `mcpplibs.llmapi@0.2.3`, kind = "lib"; lib root convention picks `src/llmapi.cppm` (already exports `module mcpplibs.llmapi;` and re-exports every partition). * `[build].include_dirs = ["src/json"]` — needed because `src/json/json.cppm` does `#include `. * Direct deps: `mbedtls = "3.6.1"` and `mcpplibs.tinyhttps = "0.2.1"`. mbedtls is technically a transitive (tinyhttps depends on it), but mcpp 0.0.2 doesn't propagate dep includes through the graph yet, so we list it explicitly. Will be cleaned up once that lands upstream. Adds `target/` to `.gitignore` for the same reason as tinyhttps. Verified: `mcpp build` produces `libllmapi.a` containing 125 objects (llmapi modules + tinyhttps modules + mbedtls translation units). --- .gitignore | 3 +++ mcpp.lock | 13 +++++++++++++ mcpp.toml | 28 ++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 mcpp.lock create mode 100644 mcpp.toml diff --git a/.gitignore b/.gitignore index 66c473c..21573a5 100644 --- a/.gitignore +++ b/.gitignore @@ -62,3 +62,6 @@ Thumbs.db # Xlings .xlings + +# mcpp build artefacts +target/ diff --git a/mcpp.lock b/mcpp.lock new file mode 100644 index 0000000..0ce7ff6 --- /dev/null +++ b/mcpp.lock @@ -0,0 +1,13 @@ +# Auto-generated by mcpp. Do not edit by hand. +version = 1 + +[package."mbedtls"] +version = "3.6.1" +source = "mcpp-index+https://github.com/mcpp-community/mcpp-index.git" +hash = "sha256:" + +[package."mcpplibs.tinyhttps"] +version = "0.2.1" +source = "mcpp-index+https://github.com/mcpp-community/mcpp-index.git" +hash = "sha256:" + diff --git a/mcpp.toml b/mcpp.toml new file mode 100644 index 0000000..793a716 --- /dev/null +++ b/mcpp.toml @@ -0,0 +1,28 @@ +[package] +name = "mcpplibs.llmapi" +version = "0.2.3" +description = "Modern C++ LLM API client with openai-compatible support" +license = "Apache-2.0" +repo = "https://github.com/mcpplibs/llmapi" + +[build] +# `src/json/json.cppm` does `#include `; expose its sibling +# header by adding `src/json` to the include search path. +include_dirs = ["src/json"] + +[targets.llmapi] +kind = "lib" + +# Library convention picks `src/llmapi.cppm` automatically — that file +# already does `export module mcpplibs.llmapi;` and re-exports every +# partition + the third-party `mcpplibs.llmapi.nlohmann.json` module, +# so consumers just `import mcpplibs.llmapi;`. + +# Direct deps. mbedtls is also pulled by mcpplibs.tinyhttps, but mcpp +# 0.0.2 doesn't propagate transitive includes — list it here so its +# headers are visible while compiling tinyhttps's TLS partition. +[dependencies] +mbedtls = "3.6.1" + +[dependencies.mcpplibs] +tinyhttps = "0.2.1"