Skip to content

Commit

Permalink
xpack: add package (#2610)
Browse files Browse the repository at this point in the history
  • Loading branch information
star-hengxing authored Sep 17, 2023
1 parent 13ad383 commit e86ceda
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions packages/x/xpack/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package("xpack")
set_kind("library", {headeronly = true})
set_homepage("https://github.com/xyz347/xpack")
set_description("convert json/xml/bson to c++ struct")
set_license("Apache-2.0")

add_urls("https://github.com/xyz347/xpack/archive/refs/tags/$(version).tar.gz",
"https://github.com/xyz347/xpack.git")

add_versions("v1.0.5", "ea8693dd3a53d54e0c1e3c9e6e06f31ff7f593f7f8cf8fb4889f5c3354dbae8e")

add_deps("rapidjson")

on_install(function (package)
os.cp("rapidxml", package:installdir("include"))
os.cp("*.h", package:installdir("include", "xpack"))
end)

on_test(function (package)
assert(package:check_cxxsnippets({test = [[
#include <xpack/json.h>
struct User {
int id;
std::string name;
XPACK(O(id, name));
};
void test() {
User u;
std::string data = "{\"id\":12345, \"name\":\"xpack\"}";
xpack::json::decode(data, u);
}
]]}, {configs = {languages = "c++11"}}))
end)

0 comments on commit e86ceda

Please sign in to comment.