xmake.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package("glaze")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/stephenberry/glaze")
  4. set_description("Extremely fast, in memory, JSON and interface library for modern C++")
  5. add_urls("https://github.com/stephenberry/glaze/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/stephenberry/glaze.git")
  7. add_versions("v1.3.5", "de5d59cb7f31193d45f67f25d8ced1499df50c0d926a1461432b87f2b2368817")
  8. on_install(function (package)
  9. os.cp("include", package:installdir())
  10. end)
  11. on_test(function (package)
  12. assert(package:check_cxxsnippets({test = [[
  13. #include <glaze/glaze.hpp>
  14. struct obj_t
  15. {
  16. double x{};
  17. float y{};
  18. };
  19. template <>
  20. struct glz::meta<obj_t>
  21. {
  22. using T = obj_t;
  23. static constexpr auto value = object("x", &T::x);
  24. };
  25. void test() {
  26. std::string buffer{};
  27. obj_t obj{};
  28. glz::write_json(obj, buffer);
  29. }
  30. ]]}, {configs = {languages = "c++20"}}))
  31. end)