xmake.lua 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. package("yy-thunks")
  2. set_homepage("https://github.com/Chuyu-Team/YY-Thunks")
  3. set_description("Fix DecodePointer, EncodePointer,RegDeleteKeyEx etc. APIs not found in Windows XP RTM.")
  4. set_license("MIT")
  5. add_urls("https://github.com/Chuyu-Team/YY-Thunks/releases/download/v$(version)/YY-Thunks-$(version)-Binary.zip")
  6. add_versions("1.0.9", "216b88757f28075d3d8c0363139e870d49ba84458fc10a0f094f264ebf0a302c")
  7. add_versions("1.0.7", "3607a79ac37f141cbcbf00aaea8d82a4c2628d81d8dad9e2a4dce4c8c17a025b")
  8. on_install("windows|x64", "windows|x86", function (package)
  9. import("core.tool.toolchain")
  10. -- check vs version
  11. local vs = toolchain.load("msvc"):config("vs")
  12. if vs and tonumber(vs) < 2005 then
  13. raise("YY-Thunks only supports VS2008 or later versions")
  14. end
  15. if package:is_arch("x64") then
  16. os.cp("objs/x64/*.obj", package:installdir("lib"))
  17. elseif package:is_arch("x86") then
  18. os.cp("objs/x86/*.obj", package:installdir("lib"))
  19. else
  20. raise("Unsupported architecture!")
  21. end
  22. end)
  23. on_test(function (package)
  24. local obj = path.join(package:installdir("lib"), "YY_Thunks_for_WinXP.obj")
  25. assert(os.isfile(obj))
  26. end)