xmake.lua 1.0 KB

1234567891011121314151617181920212223242526272829
  1. package("picojson")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://pocoproject.org/")
  4. set_description("A header-file-only, JSON parser serializer in C++")
  5. set_license("BSD-2-Clause")
  6. add_urls("https://github.com/kazuho/picojson/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/kazuho/picojson.git")
  8. add_versions("v1.3.0", "056805ca2691798f5545935a14bb477f2e1d827c9fb862e6e449dbea22801c7d")
  9. on_install(function (package)
  10. os.cp("picojson.h", package:installdir("include"))
  11. end)
  12. on_test(function(package)
  13. assert(package:check_cxxsnippets({
  14. test = [[
  15. static void test() {
  16. std::string json = "[ \"hello JSON\" ]";
  17. picojson::value v;
  18. std::string err = picojson::parse(v, json);
  19. if (! err.empty()) {
  20. std::cerr << err << std::endl;
  21. }
  22. }
  23. ]]
  24. }, {configs = {languages = "c++11"}, includes = {"picojson.h"}}))
  25. end)