xmake.lua 1.1 KB

12345678910111213141516171819202122232425262728
  1. package("arduinojson")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://arduinojson.org")
  4. set_description("📟 JSON library for Arduino and embedded C++. Simple and efficient.")
  5. set_license("MIT")
  6. add_urls("https://github.com/bblanchon/ArduinoJson/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/bblanchon/ArduinoJson.git")
  8. add_versions("v7.0.3", "6da2d069e0caa0c829444912ee13e78bdf9cc600be632428a164c92e69528000")
  9. add_versions("v6.21.4", "9551af9282372f6e64cf4009fc43be7f2df6eb96fe9c0aab44d4eed217d09747")
  10. add_deps("cmake")
  11. on_install(function (package)
  12. import("package.tools.cmake").install(package, {"-DBUILD_TESTING=OFF"})
  13. end)
  14. on_test(function (package)
  15. assert(package:check_cxxsnippets({test = [[
  16. #include <ArduinoJson.h>
  17. void test() {
  18. char json[] = "{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}";
  19. DynamicJsonDocument doc(1024);
  20. deserializeJson(doc, json);
  21. }
  22. ]]}, {configs = {languages = "c++11"}}))
  23. end)