xmake.lua 1.0 KB

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