From 15b3c96e5da2abbc51499cf9c6094b4e0412df6a Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 25 Jun 2022 21:46:10 +0800 Subject: [PATCH] add littlefs (#1301) * add littlefs * disable error * disable error --- packages/l/littlefs/xmake.lua | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 packages/l/littlefs/xmake.lua diff --git a/packages/l/littlefs/xmake.lua b/packages/l/littlefs/xmake.lua new file mode 100644 index 000000000..3c7f680ef --- /dev/null +++ b/packages/l/littlefs/xmake.lua @@ -0,0 +1,29 @@ +package("littlefs") + set_homepage("https://github.com/littlefs-project/littlefs") + set_description("A little fail-safe filesystem designed for microcontrollers") + + add_urls("https://github.com/littlefs-project/littlefs/archive/refs/tags/$(version).tar.gz", + "https://github.com/littlefs-project/littlefs.git") + add_versions("v2.5.0", "07de0d788c2a849a137715b48cce9daeb3fdc7570873ac6faae4566432e140c8") + + on_install(function (package) + local configs = {} + io.writefile("xmake.lua", [[ + add_rules("mode.release", "mode.debug") + target("littlefs") + set_kind("$(kind)") + add_files("*.c") + add_headerfiles("*.h") + if is_plat("windows") then + add_defines("LFS_NO_ERROR", "LFS_NO_DEBUG", "LFS_NO_WARN") + end + ]]) + if package:config("shared") then + configs.kind = "shared" + end + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("lfs_mount", {includes = "lfs.h"})) + end)