From d40faadb9587dae4286f1bbd61f6b630f2472a47 Mon Sep 17 00:00:00 2001 From: Qudix <17361645+Qudix@users.noreply.github.com> Date: Thu, 6 Apr 2023 01:35:59 -0500 Subject: [PATCH] [convertutf] Add package (#1972) * [convertutf] Add package * [convertutf] Date * [convertutf] Export symbols when kind is `shared` * [convertutf] Export symbols on windows only --- packages/c/convertutf/xmake.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 packages/c/convertutf/xmake.lua diff --git a/packages/c/convertutf/xmake.lua b/packages/c/convertutf/xmake.lua new file mode 100644 index 000000000..5277239cd --- /dev/null +++ b/packages/c/convertutf/xmake.lua @@ -0,0 +1,27 @@ +package("convertutf") + set_homepage("https://home.unicode.org/") + set_description("Conversions between UTF-32, UTF-16, and UTF-8. Circa 2004.") + + set_urls("https://github.com/xmake-mirror/convertutf/archive/refs/tags/$(version).tar.gz", + "https://github.com/xmake-mirror/convertutf.git") + add_versions("v1.0.1", "ecd79378cc9f24034a2edebf5f198e84c9eb8046261f8208908d2b29d4fa4d99") + + on_install(function (package) + io.writefile("xmake.lua", [[ + target("convertutf") + set_kind("$(kind)") + set_languages("c99") + add_files("ConvertUTF.c") + add_headerfiles("ConvertUTF.h") + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all") + end + ]]) + local configs = {} + configs.kind = package:config("shared") and "shared" or "static" + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("ConvertUTF8toUTF16", {includes = "ConvertUTF.h"})) + end)