Skip to content

Commit

Permalink
wirehair: add package
Browse files Browse the repository at this point in the history
  • Loading branch information
star-hengxing committed Sep 28, 2024
1 parent 4e98d47 commit 9711782
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions packages/w/wirehair/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package("wirehair")
set_homepage("http://wirehairfec.com")
set_description("Wirehair : O(N) Fountain Code for Large Data")
set_license("BSD-3-Clause")

add_urls("https://github.com/catid/wirehair.git")

add_versions("2023.12.02", "557c00c707a4b6a51db312c113b8036dadbe132e")

on_install(function (package)
if package:is_plat("windows") and package:config("shared") then
package:add("defines", "WIREHAIR_DLL")
end

io.writefile("xmake.lua", [[
add_rules("mode.debug", "mode.release")
set_languages("c++11")
target("wirehair")
set_kind("$(kind)")
add_files("*.cpp")
add_includedirs("include")
add_headerfiles("include/(wirehair/*.h)")
if is_plat("windows") and is_kind("shared") then
add_defines("WIREHAIR_BUILDING", "WIREHAIR_DLL")
end
add_installfiles("python/*.py", {prefixdir = "python"})
]])
import("package.tools.xmake").install(package)
end)

on_test(function (package)
assert(package:has_cfuncs("wirehair_encoder_create", {includes = "wirehair/wirehair.h"}))
end)

0 comments on commit 9711782

Please sign in to comment.