From 354d61e186212957cce3595b3f64d4d433850113 Mon Sep 17 00:00:00 2001 From: Peter Richmond <3448039+burdockcascade@users.noreply.github.com> Date: Sun, 1 Sep 2024 01:19:35 +0100 Subject: [PATCH] add c-vector (#5107) * add c-vector * fix kind value * fix for windows --- packages/c/c-vector/xmake.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 packages/c/c-vector/xmake.lua diff --git a/packages/c/c-vector/xmake.lua b/packages/c/c-vector/xmake.lua new file mode 100644 index 000000000..4feaef135 --- /dev/null +++ b/packages/c/c-vector/xmake.lua @@ -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)