xmake.lua 1.1 KB

123456789101112131415161718192021222324252627
  1. package("convertutf")
  2. set_homepage("https://home.unicode.org/")
  3. set_description("Conversions between UTF-32, UTF-16, and UTF-8. Circa 2004.")
  4. set_urls("https://github.com/xmake-mirror/convertutf/archive/refs/tags/$(version).tar.gz",
  5. "https://github.com/xmake-mirror/convertutf.git")
  6. add_versions("v1.0.1", "ecd79378cc9f24034a2edebf5f198e84c9eb8046261f8208908d2b29d4fa4d99")
  7. on_install(function (package)
  8. io.writefile("xmake.lua", [[
  9. target("convertutf")
  10. set_kind("$(kind)")
  11. set_languages("c99")
  12. add_files("ConvertUTF.c")
  13. add_headerfiles("ConvertUTF.h")
  14. if is_plat("windows") and is_kind("shared") then
  15. add_rules("utils.symbols.export_all")
  16. end
  17. ]])
  18. local configs = {}
  19. configs.kind = package:config("shared") and "shared" or "static"
  20. import("package.tools.xmake").install(package, configs)
  21. end)
  22. on_test(function (package)
  23. assert(package:has_cfuncs("ConvertUTF8toUTF16", {includes = "ConvertUTF.h"}))
  24. end)