xmake.lua 1.1 KB

123456789101112131415161718192021222324252627
  1. package("mhook")
  2. set_homepage("https://github.com/martona/mhook")
  3. set_description("A Windows API hooking library ")
  4. set_license("MIT")
  5. set_urls("https://github.com/apriorit/mhook.git")
  6. add_versions("2022.04.12", "93ce2fcc6f91c9ee696a04fc07798e7cb13a6070")
  7. on_install("windows|!arm*", "mingw|!arm*", "msys", function (package)
  8. io.writefile("xmake.lua", [[
  9. add_rules("mode.debug", "mode.release")
  10. target("mhook")
  11. set_kind("$(kind)")
  12. add_files("disasm-lib/*.c", "mhook-lib/*.c")
  13. add_headerfiles("(mhook-lib/*.h)")
  14. add_defines("NO_SANITY_CHECKS", "UNICODE", "_UNICODE", "WIN32_LEAN_AND_MEAN")
  15. if is_plat("windows") and is_kind("shared") then
  16. add_rules("utils.symbols.export_all")
  17. end
  18. ]])
  19. import("package.tools.xmake").install(package)
  20. end)
  21. on_test(function (package)
  22. assert(package:has_cxxfuncs("Mhook_SetHookEx", {includes = {"windows.h", "mhook-lib/mhook.h"}}))
  23. end)