Skip to content

Commit 72cdf18

Browse files
committed
fix xmake package issue
1 parent 6249900 commit 72cdf18

File tree

4 files changed

+71
-5
lines changed

4 files changed

+71
-5
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Clean, type-safe LLM API client using C++23 modules. Fluent interface with zero-
2323
- **C API** - Full C language support with OOP style
2424
- **Provider Agnostic** - OpenAI, Poe, and compatible endpoints
2525

26-
## 📦 Quick Start
26+
## Quick Start
2727

2828
### C++ API
2929

@@ -89,6 +89,27 @@ xmake # Build
8989
xmake run basic # Run example(after cofig OPENAI_API_KEY)
9090
```
9191

92+
## 📦 Use in Build Tools
93+
94+
### xmake
95+
96+
```lua
97+
-- 0 - Add mcpplibs's index repos
98+
add_repositories("mcpplibs-index git@github.com:mcpplibs/mcpplibs-index.git")
99+
100+
-- 1 - Add the libraries and versions you need
101+
add_requires("llmapi 0.0.1")
102+
-- add_requires("llmapi 0.0.1", configs = { capi = true }) -- if use c api
103+
```
104+
105+
> More: [mcpplibs-index](https://github.com/mcpplibs/mcpplibs-index)
106+
107+
### cmake
108+
109+
```
110+
todo...
111+
```
112+
92113
## 📚 API Reference
93114

94115
**C++ Core Methods:**

README.zh.hant.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
- **C 語言 API** - 完整的 C 語言支援,物件導向風格
2424
- **提供商無關** - OpenAI、Poe 及相容端點
2525

26-
## 📦 快速開始
26+
## 快速開始
2727

2828
### C++ API
2929

@@ -89,6 +89,27 @@ xmake # 建置
8989
xmake run basic # 執行範例(需先設定 OPENAI_API_KEY)
9090
```
9191

92+
## 📦 在建置工具中使用
93+
94+
### xmake
95+
96+
```lua
97+
-- 0 - 新增 mcpplibs 索引倉庫
98+
add_repositories("mcpplibs-index git@github.com:mcpplibs/mcpplibs-index.git")
99+
100+
-- 1 - 新增需要的函式庫和版本
101+
add_requires("llmapi 0.0.1")
102+
-- add_requires("llmapi 0.0.1", configs = { capi = true }) -- 如果使用 C API
103+
```
104+
105+
> More: [mcpplibs-index](https://github.com/mcpplibs/mcpplibs-index)
106+
107+
### cmake
108+
109+
```
110+
todo...
111+
```
112+
92113
## 📚 API 參考
93114

94115
**C++ 核心方法:**

README.zh.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
- **C 语言 API** - 完整的 C 语言支持,面向对象风格
2424
- **提供商无关** - OpenAI、Poe 及兼容端点
2525

26-
## 📦 快速开始
26+
## 快速开始
2727

2828
### C++ API
2929

@@ -89,6 +89,27 @@ xmake # 构建
8989
xmake run basic # 运行示例(需要先配置 OPENAI_API_KEY)
9090
```
9191

92+
## 📦 在构建工具中使用
93+
94+
### xmake
95+
96+
```lua
97+
-- 0 - 添加 mcpplibs 索引仓库
98+
add_repositories("mcpplibs-index git@github.com:mcpplibs/mcpplibs-index.git")
99+
100+
-- 1 - 添加需要的库和版本
101+
add_requires("llmapi 0.0.1")
102+
-- add_requires("llmapi 0.0.1", configs = { capi = true }) -- 如果使用 C API
103+
```
104+
105+
> More: [mcpplibs-index](https://github.com/mcpplibs/mcpplibs-index)
106+
107+
### cmake
108+
109+
```
110+
todo...
111+
```
112+
92113
## 📚 API 参考
93114

94115
**C++ 核心方法:**

xmake.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
--add_rules("mode.debug", "mode.release")
2+
13
add_requires("libcurl 8.11.0")
24

35
--includes("src/json")
@@ -6,7 +8,7 @@ set_languages("c++23")
68

79
target("llmapi")
810
set_kind("static")
9-
add_files("src/*.cppm", { public = true })
11+
add_files("src/*.cppm", { public = true, install = true })
1012
add_packages("libcurl")
1113
--add_deps("__nlohmann_json")
1214
add_includedirs("src/json")
@@ -18,7 +20,8 @@ target("llmapi")
1820
add_cxxflags("-fPIC")
1921

2022
target("llmapi_c")
21-
set_kind("shared")
23+
--set_kind("shared")
24+
set_kind("static")
2225
add_files("src/c/llmapi.cpp")
2326
add_deps("llmapi")
2427
add_packages("libcurl")

0 commit comments

Comments
 (0)