xmake.lua 1.3 KB

123456789101112131415161718192021222324252627282930
  1. package("npcap_sdk")
  2. set_homepage("https://npcap.com/")
  3. set_description("Npcap is the Nmap Project's packet capture (and sending) library for Microsoft Windows.")
  4. set_urls("https://npcap.com/dist/npcap-sdk-$(version).zip")
  5. add_versions("1.15", "52c7b9fb4abee3ad9fe739bb545c3efe77b731c8e127122bdf328eafdae3ed4f")
  6. add_versions("1.13", "dad1f2bf1b02b787be08ca4862f99e39a876c1f274bac4ac0cedc9bbc58f94fd")
  7. add_versions("1.12", "24c4862723f61d28048a24e10eb31d2269b2152a5762410dd1caffc041871337")
  8. set_policy("package.precompiled", false)
  9. on_install("windows", "mingw", "msys", "cygwin", function (package)
  10. if not package:is_plat("windows") and package:version():le("1.15") then
  11. package:add("defines", "_Post_invalid_=")
  12. end
  13. os.cp("Include/*", package:installdir("include"))
  14. if package:is_arch("arm64.*", "aarch64") then
  15. os.cp("Lib/ARM64/*", package:installdir("lib"))
  16. elseif package:is_arch("x86") or package:is_arch("i386") then
  17. os.cp("Lib/*.lib", package:installdir("lib"))
  18. else
  19. os.cp("Lib/x64/*.lib", package:installdir("lib"))
  20. end
  21. end)
  22. on_test(function (package)
  23. assert(package:has_cfuncs("PacketGetVersion", {includes = "Packet32.h"}))
  24. end)