Skip to content

Commit dbebb1e

Browse files
committed
fix: improve llmapi + tinyhttps package definitions
llmapi: - Move deps to on_load with version check (tinyhttps only for >=0.2.0) - Remove global add_deps that applied to all versions including 0.0.x - Add on_test for install verification - Update test to 0.2.6 tinyhttps: - Move deps to on_load (mbedtls >=3.6.1) - Remove global add_deps - Add target="tinyhttps" to install (only install lib, not tests) - Add on_test for install verification
1 parent 8c6b56e commit dbebb1e

3 files changed

Lines changed: 27 additions & 5 deletions

File tree

packages/l/llmapi/xmake.lua

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,26 @@ package("llmapi")
1919
add_versions("0.0.1", "174f86d3afdf48a57ad1cc9688718d1f1100a78a7e56686c823c573c3ccf99f4")
2020

2121
add_includedirs("include")
22-
add_deps("mcpplibs-tinyhttps 0.2.2")
2322

2423
on_load(function (package)
2524
package:add("links", "llmapi")
25+
-- tinyhttps dependency only for 0.2.0+ (earlier versions used libcurl)
26+
if package:version():ge("0.2.0") then
27+
package:add("deps", "mcpplibs-tinyhttps >=0.2.0")
28+
end
2629
end)
2730

2831
on_install(function (package)
2932
local configs = {}
3033
import("package.tools.xmake").install(package, configs, {target = "llmapi"})
3134
end)
35+
36+
on_test(function (package)
37+
assert(package:check_cxxsnippets({test = [[
38+
import llmapi;
39+
void test() {
40+
llmapi::Config cfg;
41+
cfg.model = "test";
42+
}
43+
]]}, {configs = {languages = "c++23"}}))
44+
end)

packages/m/mcpplibs-tinyhttps/xmake.lua

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,22 @@ package("mcpplibs-tinyhttps")
1414
add_versions("0.2.0", "81dab607227f353fa83068d4fee47b6877ceff891719a60a9cd75eaf827fab44")
1515
add_versions("0.1.0", "af7daa6a63f264070a1ac8fe42725713ba7ea54e58f1e8b8e190d1b4c58a0896")
1616

17-
add_deps("mbedtls 3.6.1")
18-
1917
on_load(function (package)
2018
package:add("links", "tinyhttps")
19+
package:add("deps", "mbedtls >=3.6.1")
2120
end)
2221

2322
on_install(function (package)
2423
local configs = {}
25-
import("package.tools.xmake").install(package, configs)
24+
import("package.tools.xmake").install(package, configs, {target = "tinyhttps"})
25+
end)
26+
27+
on_test(function (package)
28+
assert(package:check_cxxsnippets({test = [[
29+
import tinyhttps;
30+
void test() {
31+
tinyhttps::HttpRequest req;
32+
req.url = "https://example.com";
33+
}
34+
]]}, {configs = {languages = "c++23"}}))
2635
end)

tests/l/llmapi/xmake.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_requires("llmapi 0.2.5")
1+
add_requires("llmapi 0.2.6")
22

33
target("llmapi_test")
44
set_kind("binary")

0 commit comments

Comments
 (0)