xmake.lua 1.1 KB

1234567891011121314151617181920212223242526272829
  1. package("littlefs")
  2. set_homepage("https://github.com/littlefs-project/littlefs")
  3. set_description("A little fail-safe filesystem designed for microcontrollers")
  4. add_urls("https://github.com/littlefs-project/littlefs/archive/refs/tags/$(version).tar.gz",
  5. "https://github.com/littlefs-project/littlefs.git")
  6. add_versions("v2.5.0", "07de0d788c2a849a137715b48cce9daeb3fdc7570873ac6faae4566432e140c8")
  7. on_install(function (package)
  8. local configs = {}
  9. io.writefile("xmake.lua", [[
  10. add_rules("mode.release", "mode.debug")
  11. target("littlefs")
  12. set_kind("$(kind)")
  13. add_files("*.c")
  14. add_headerfiles("*.h")
  15. if is_plat("windows") then
  16. add_defines("LFS_NO_ERROR", "LFS_NO_DEBUG", "LFS_NO_WARN")
  17. end
  18. ]])
  19. if package:config("shared") then
  20. configs.kind = "shared"
  21. end
  22. import("package.tools.xmake").install(package, configs)
  23. end)
  24. on_test(function (package)
  25. assert(package:has_cfuncs("lfs_mount", {includes = "lfs.h"}))
  26. end)