xmake.lua 1.1 KB

12345678910111213141516171819202122232425
  1. package("distorm")
  2. set_homepage("https://github.com/gdabah/distorm")
  3. set_description("Powerful Disassembler Library For x86/AMD64")
  4. add_urls("https://github.com/gdabah/distorm.git")
  5. add_versions("2021.12.18", "7a02caa1a936f0a653fc75f1aaea9bd3fa654603")
  6. on_install(function (package)
  7. io.replace("src/textdefs.c", "RSHORT(&s->p[i]) = RSHORT(&TextBTable[(*buf) * 2]);", "s->p[i] = TextBTable[(*buf) * 2];s->p[i + 1] = TextBTable[(*buf) * 2 + 1];", {plain = true})
  8. io.writefile("xmake.lua", [[
  9. add_rules("mode.release", "mode.debug")
  10. target("distorm")
  11. set_kind("$(kind)")
  12. add_files("src/*.c")
  13. add_headerfiles("include/*.h", {prefixdir = "distorm"})
  14. if is_plat("windows") and is_kind("shared") then
  15. add_rules("utils.symbols.export_all")
  16. end
  17. ]])
  18. import("package.tools.xmake").install(package)
  19. end)
  20. on_test(function (package)
  21. assert(package:has_cfuncs("distorm_version", {includes = "distorm/distorm.h"}))
  22. end)