xmake.lua 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. package("rpmalloc")
  2. set_homepage("https://github.com/mjansson/rpmalloc")
  3. set_description("Public domain cross platform lock free thread caching 16-byte aligned memory allocator implemented in C")
  4. set_license("MIT")
  5. add_urls("https://github.com/mjansson/rpmalloc/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/mjansson/rpmalloc.git")
  7. add_versions("1.4.5", "2513626697ef72a60957acc8caed17c39931a55c1a49202707de195742683d69")
  8. add_versions("1.4.4", "3859620c03e6473f0b3f16a4e965e7c049594253f70e8370fb9caa0e4118accb")
  9. if is_plat("windows") then
  10. add_syslinks("advapi32")
  11. end
  12. on_install("!wasm", function (package)
  13. io.writefile("xmake.lua", [[
  14. add_rules("mode.release", "mode.debug")
  15. target("rpmalloc")
  16. set_kind("$(kind)")
  17. add_files("rpmalloc/rpmalloc.c")
  18. add_headerfiles("rpmalloc/(*.h)")
  19. if is_plat("windows") and is_kind("shared") then
  20. add_rules("utils.symbols.export_all")
  21. add_syslinks("advapi32")
  22. end
  23. ]])
  24. import("package.tools.xmake").install(package)
  25. end)
  26. on_test(function (package)
  27. assert(package:has_cfuncs("rpmalloc", {includes = "rpmalloc.h"}))
  28. end)