xmake.lua 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package("wirehair")
  2. set_homepage("http://wirehairfec.com")
  3. set_description("Wirehair : O(N) Fountain Code for Large Data")
  4. set_license("BSD-3-Clause")
  5. add_urls("https://github.com/catid/wirehair.git")
  6. add_versions("2023.12.02", "557c00c707a4b6a51db312c113b8036dadbe132e")
  7. if on_check then
  8. on_check("mingw", function (package)
  9. if is_host("macosx") then
  10. raise("package(wirehair) unsupport mingw plat on macosx")
  11. end
  12. end)
  13. end
  14. on_install("!macosx and !iphoneos and !wasm and (!windows or windows|!arm64)", function (package)
  15. if package:is_plat("windows") and package:config("shared") then
  16. package:add("defines", "WIREHAIR_DLL")
  17. end
  18. io.writefile("xmake.lua", [[
  19. add_rules("mode.debug", "mode.release")
  20. set_languages("c++11")
  21. add_vectorexts("all")
  22. target("wirehair")
  23. set_kind("$(kind)")
  24. add_files("*.cpp")
  25. add_includedirs("include")
  26. add_headerfiles("include/(wirehair/*.h)")
  27. if is_plat("windows") and is_kind("shared") then
  28. add_defines("WIREHAIR_BUILDING", "WIREHAIR_DLL")
  29. end
  30. add_installfiles("python/*.py", {prefixdir = "python"})
  31. ]])
  32. import("package.tools.xmake").install(package)
  33. end)
  34. on_test(function (package)
  35. assert(package:has_cfuncs("wirehair_encoder_create", {includes = "wirehair/wirehair.h"}))
  36. end)