xmake.lua 1.3 KB

1234567891011121314151617181920212223242526272829
  1. package("iowow")
  2. set_homepage("https://iowow.softmotions.com")
  3. set_description("A C utility library and persistent key/value storage engine")
  4. set_license("MIT")
  5. add_urls("https://github.com/Softmotions/iowow/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/Softmotions/iowow.git")
  7. add_versions("v1.4.18", "ef4ee56dd77ce326fff25b6f41e7d78303322cca3f11cf5683ce9abfda34faf9")
  8. add_versions("v1.4.17", "13a851026dbc1f31583fba96986e86e94a7554f9e7d38aa12a9ea5dbebdf328b")
  9. if is_plat("linux", "bsd") then
  10. add_syslinks("pthread")
  11. end
  12. add_deps("cmake")
  13. on_install("linux", "macosx", "bsd", "cross", function (package)
  14. io.replace("src/utils/sort_r.h", "defined __FreeBSD__ ||", "", {plain = true})
  15. local configs = {"-DBUILD_EXAMPLES=OFF", "-DPACKAGE_TGZ=OFF", "-DPACKAGE_ZIP=OFF"}
  16. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  17. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  18. table.insert(configs, "-DASAN=" .. (package:config("asan") and "ON" or "OFF"))
  19. import("package.tools.cmake").install(package, configs)
  20. end)
  21. on_test(function (package)
  22. assert(package:has_cfuncs("iwkv_init", {includes = "iowow/iwkv.h"}))
  23. end)