xmake.lua 1.5 KB

12345678910111213141516171819202122232425262728
  1. package("zziplib")
  2. set_homepage("http://zziplib.sourceforge.net/")
  3. set_description("The zziplib library is intentionally lightweight, it offers the ability to easily extract data from files archived in a single zip file.")
  4. set_license("GPL-2.0")
  5. add_urls("https://github.com/gdraheim/zziplib/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/gdraheim/zziplib.git")
  7. add_versions("v0.13.72", "93ef44bf1f1ea24fc66080426a469df82fa631d13ca3b2e4abaeab89538518dc")
  8. add_deps("cmake", "zlib")
  9. on_install("windows", "macosx", "linux", function (package)
  10. local configs = {"-DZZIPTEST=OFF", "-DZZIPDOCS=OFF", "-DZZIPWRAP=OFF", "-DZZIPSDL=OFF", "-DZZIPMMAPPED=OFF", "-DZZIPFSEEKO=OFF", "-DZZIPBINS=OFF"}
  11. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  12. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  13. table.insert(configs, "-DBUILD_STATIC_LIBS=" .. (package:config("shared") and "OFF" or "ON"))
  14. if package:is_plat("windows") then
  15. table.insert(configs, "-DMSVC_STATIC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
  16. end
  17. if package:config("pic") ~= false then
  18. table.insert(configs, "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
  19. end
  20. import("package.tools.cmake").install(package, configs)
  21. end)
  22. on_test(function (package)
  23. assert(package:has_cfuncs("zzip_open", {includes = "zzip/zzip.h"}))
  24. end)