From 121e2009042ad8884bb19df0501b35e2097a80ab Mon Sep 17 00:00:00 2001 From: star9029 Date: Mon, 1 Jan 2024 18:13:02 +0800 Subject: [PATCH] tinyalloc: add package (#3015) * tinyalloc: add package * remove defines --- packages/t/tinyalloc/xmake.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 packages/t/tinyalloc/xmake.lua diff --git a/packages/t/tinyalloc/xmake.lua b/packages/t/tinyalloc/xmake.lua new file mode 100644 index 000000000..6b2bb2cce --- /dev/null +++ b/packages/t/tinyalloc/xmake.lua @@ -0,0 +1,25 @@ +package("tinyalloc") + set_homepage("https://github.com/thi-ng/tinyalloc") + set_description("malloc / free replacement for unmanaged, linear memory situations (e.g. WASM, embedded devices...)") + set_license("Apache-2.0") + + add_urls("https://github.com/thi-ng/tinyalloc.git") + add_versions("2021.10.08", "b60fcd7a351dea8a51f3ec95b19fc0d0d2e4dcd9") + + on_install(function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.release", "mode.debug") + target("tinyalloc") + set_kind("$(kind)") + add_files("tinyalloc.c") + add_headerfiles("tinyalloc.h") + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all") + end + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:has_cfuncs("ta_init", {includes = "tinyalloc.h"})) + end)