xmake.lua 1.2 KB

1234567891011121314151617181920212223242526272829
  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.4", "98ca14d98e9f1e8978ce5ad3ca0eeda3d22419d17586c60f299f369078929917")
  9. add_versions("v7.0.3", "6da2d069e0caa0c829444912ee13e78bdf9cc600be632428a164c92e69528000")
  10. add_versions("v6.21.4", "9551af9282372f6e64cf4009fc43be7f2df6eb96fe9c0aab44d4eed217d09747")
  11. add_deps("cmake")
  12. on_install(function (package)
  13. import("package.tools.cmake").install(package, {"-DBUILD_TESTING=OFF"})
  14. end)
  15. on_test(function (package)
  16. assert(package:check_cxxsnippets({test = [[
  17. #include <ArduinoJson.h>
  18. void test() {
  19. char json[] = "{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}";
  20. DynamicJsonDocument doc(1024);
  21. deserializeJson(doc, json);
  22. }
  23. ]]}, {configs = {languages = "c++11"}}))
  24. end)