From e4de08bc3986fcfaeb8b67a6680f7c8270160e29 Mon Sep 17 00:00:00 2001 From: star9029 Date: Sat, 19 Aug 2023 21:48:46 +0800 Subject: [PATCH] glaze: add package (#2462) --- packages/g/glaze/xmake.lua | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 packages/g/glaze/xmake.lua diff --git a/packages/g/glaze/xmake.lua b/packages/g/glaze/xmake.lua new file mode 100644 index 000000000..85b60169f --- /dev/null +++ b/packages/g/glaze/xmake.lua @@ -0,0 +1,35 @@ +package("glaze") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/stephenberry/glaze") + set_description("Extremely fast, in memory, JSON and interface library for modern C++") + + add_urls("https://github.com/stephenberry/glaze/archive/refs/tags/$(version).tar.gz", + "https://github.com/stephenberry/glaze.git") + + add_versions("v1.3.5", "de5d59cb7f31193d45f67f25d8ced1499df50c0d926a1461432b87f2b2368817") + + on_install(function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + struct obj_t + { + double x{}; + float y{}; + }; + template <> + struct glz::meta + { + using T = obj_t; + static constexpr auto value = object("x", &T::x); + }; + void test() { + std::string buffer{}; + obj_t obj{}; + glz::write_json(obj, buffer); + } + ]]}, {configs = {languages = "c++20"}})) + end)