xmake.lua 1.2 KB

12345678910111213141516171819202122232425262728
  1. package("miniz")
  2. set_homepage("https://github.com/richgel999/miniz/")
  3. set_description("miniz: Single C source file zlib-replacement library")
  4. set_license("MIT")
  5. add_urls("https://github.com/richgel999/miniz/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/richgel999/miniz.git")
  7. add_versions("2.1.0", "95f9b23c92219ad2670389a23a4ed5723b7329c82c3d933b7047673ecdfc1fea")
  8. add_versions("2.2.0", "bd1136d0a1554520dcb527a239655777148d90fd2d51cf02c36540afc552e6ec")
  9. add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
  10. on_install(function (package)
  11. io.writefile("miniz_export.h", "#define MINIZ_EXPORT")
  12. io.writefile("xmake.lua", [[
  13. add_rules("mode.debug", "mode.release")
  14. target("miniz")
  15. set_kind("static")
  16. add_files("miniz.c", "miniz_zip.c", "miniz_tinfl.c", "miniz_tdef.c")
  17. add_headerfiles("miniz.h", "miniz_export.h", "miniz_common.h", "miniz_zip.h", "miniz_tinfl.h", "miniz_tdef.h")
  18. ]])
  19. import("package.tools.xmake").install(package)
  20. end)
  21. on_test(function (package)
  22. assert(package:has_cfuncs("mz_compress", {includes = "miniz.h"}))
  23. end)