Skip to content

Commit

Permalink
arduinojson: add package (#2981)
Browse files Browse the repository at this point in the history
  • Loading branch information
star-hengxing authored Dec 21, 2023
1 parent b2470af commit 7ebd8e5
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions packages/a/arduinojson/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package("arduinojson")
set_kind("library", {headeronly = true})
set_homepage("https://arduinojson.org")
set_description("📟 JSON library for Arduino and embedded C++. Simple and efficient.")
set_license("MIT")

add_urls("https://github.com/bblanchon/ArduinoJson/archive/refs/tags/$(version).tar.gz",
"https://github.com/bblanchon/ArduinoJson.git")

add_versions("v6.21.4", "9551af9282372f6e64cf4009fc43be7f2df6eb96fe9c0aab44d4eed217d09747")

add_deps("cmake")

on_install(function (package)
import("package.tools.cmake").install(package, {"-DBUILD_TESTING=OFF"})
end)

on_test(function (package)
assert(package:check_cxxsnippets({test = [[
#include <ArduinoJson.h>
void test() {
char json[] = "{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}";
DynamicJsonDocument doc(1024);
deserializeJson(doc, json);
}
]]}, {configs = {languages = "c++11"}}))
end)

0 comments on commit 7ebd8e5

Please sign in to comment.