xmake.lua 1.0 KB

12345678910111213141516171819202122232425
  1. package("mhook")
  2. set_homepage("https://github.com/martona/mhook")
  3. set_description("A Windows API hooking library ")
  4. set_urls("https://github.com/apriorit/mhook/archive/$(version).zip",
  5. "https://github.com/apriorit/mhook.git")
  6. add_versions("2.5.1", "37e7d65422a770b0a28835b4fe557823278f7118ff4a399d7acf345c8db318e5")
  7. add_patches("2.5.1", "https://github.com/apriorit/mhook/commit/5ccb00a9c89280bfff7ce595873a9923415172a7.patch",
  8. "56561718ccf05c8c42fff05e6531cfa525cf93e0c9fa3bd226e74ef19eae1a1f")
  9. add_deps("cmake")
  10. on_install("windows", function (package)
  11. local configs = {}
  12. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  13. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  14. import("package.tools.cmake").install(package, configs)
  15. end)
  16. on_test(function (package)
  17. assert(package:has_cxxfuncs("Mhook_SetHookEx", {includes = {"windows.h", "mhook-lib/mhook.h"}}))
  18. end)