xmake.lua 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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)-Objs.zip")
  6. add_urls("https://github.com/Chuyu-Team/YY-Thunks/releases/download/v$(version)/YY-Thunks-$(version)-Binary.zip")
  7. add_versions("1.1.5", "e6e2bb6e6b46f8b2b4af4cff2b2b754b123837a3c72f1cd5d7a5bfdf3c0df82a")
  8. add_versions("1.1.4", "f9850a35d1f2b0cae15e64da516de0ec5e798c060b320e91788aa33b853e85ba")
  9. add_versions("1.1.1", "fe79e309aa42a58794609e06382632a0b768a1193a6bb5aad0bddd4264712aba")
  10. add_versions("1.0.9", "216b88757f28075d3d8c0363139e870d49ba84458fc10a0f094f264ebf0a302c")
  11. add_versions("1.0.7", "3607a79ac37f141cbcbf00aaea8d82a4c2628d81d8dad9e2a4dce4c8c17a025b")
  12. add_configs("debug", {description = "Enable debug symbols.", default = false, readonly = true})
  13. add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
  14. set_policy("package.precompiled", false)
  15. on_install("windows|x64", "windows|x86", function (package)
  16. -- check vs version
  17. local vs = package:toolchain("msvc"):config("vs")
  18. if vs and tonumber(vs) < 2005 then
  19. raise("YY-Thunks only supports VS2008 or later versions")
  20. end
  21. if package:is_arch("x64") then
  22. os.mv("objs/x64/*.obj", package:installdir("lib"))
  23. elseif package:is_arch("x86") then
  24. os.mv("objs/x86/*.obj", package:installdir("lib"))
  25. else
  26. raise("Unsupported architecture!")
  27. end
  28. os.trymv("YY.Depends.Analyzer.exe", package:installdir("bin"))
  29. end)
  30. on_test(function (package)
  31. local obj = path.join(package:installdir("lib"), "YY_Thunks_for_WinXP.obj")
  32. assert(os.isfile(obj))
  33. end)