xmake.lua 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. package("sonic-cpp")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/bytedance/sonic-cpp")
  4. set_description("A fast JSON serializing & deserializing library, accelerated by SIMD.")
  5. set_license("Apache-2.0")
  6. add_urls("https://github.com/bytedance/sonic-cpp/archive/refs/tags/v$(version).zip")
  7. add_versions("1.0.0", "409441bfc8b8b9fea8641dc0a0cdfaeed784246066a5c49fc7d6e74c39999f7b")
  8. add_cxxflags("-march=haswell")
  9. on_install("linux", function (package)
  10. os.cp("include", package:installdir())
  11. end)
  12. on_test(function (package)
  13. assert(package:check_cxxsnippets({test = [[
  14. #include "sonic/sonic.h"
  15. #include <string>
  16. void test()
  17. {
  18. std::string json = R"(
  19. {
  20. "a": 1,
  21. "b": 2
  22. }
  23. )";
  24. sonic_json::Document doc;
  25. doc.Parse(json);
  26. }
  27. ]]}, {configs = {languages = "c++11"}}))
  28. end)