Skip to content

Commit

Permalink
add c-vector (#5107)
Browse files Browse the repository at this point in the history
* add c-vector

* fix kind value

* fix for windows
  • Loading branch information
burdockcascade committed Sep 1, 2024
1 parent bec7be4 commit 354d61e
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions packages/c/c-vector/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package("c-vector")
set_homepage("https://github.com/Mashpoe/c-vector")
set_description("A simple vector library for C that can store any type.")
set_license("BSD-3-Clause")

add_urls("https://github.com/Mashpoe/c-vector/archive/refs/tags/$(version).tar.gz",
"https://github.com/Mashpoe/c-vector.git")

add_versions("v1.0", "c1ddd2975abd54ce55309fef04cc9d47e8a356a964298f516a9e314f9fcd20d4")

on_install(function (package)
local configs = {}
io.writefile("xmake.lua", [[
add_rules("mode.release", "mode.debug")
target("c-vector")
set_kind("$(kind)")
add_files("vec.c")
add_headerfiles("vec.h")
if is_plat("windows") and is_kind("shared") then
add_rules("utils.symbols.export_all")
end
]])
if package:config("shared") then
configs.kind = "shared"
end
import("package.tools.xmake").install(package, configs)
end)

on_test(function (package)
assert(package:has_cfuncs("vector_create", {includes = "vec.h"}))
end)

0 comments on commit 354d61e

Please sign in to comment.