xmake.lua 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. package("yxml")
  2. set_homepage("https://dev.yorhel.nl/yxml")
  3. set_description("Yxml - A small, fast and correct* XML parser")
  4. set_license("MIT")
  5. add_urls("https://github.com/JulStrat/yxml.git")
  6. add_versions("2020.08.13", "cb1c99c7271a06687a6d945066533504b396652f")
  7. on_install(function (package)
  8. if package:is_plat("windows") and package:config("shared") then
  9. io.replace("yxml.h", "void yxml_init", "__declspec(dllimport) void yxml_init", {plain = true})
  10. io.replace("yxml.h", "yxml_ret_t yxml_parse", "__declspec(dllimport) yxml_ret_t yxml_parse", {plain = true})
  11. io.replace("yxml.h", "yxml_ret_t yxml_eof", "__declspec(dllimport) yxml_ret_t yxml_eof", {plain = true})
  12. end
  13. io.writefile("xmake.lua", [[
  14. add_rules("mode.release", "mode.debug")
  15. target("yxml")
  16. set_kind("$(kind)")
  17. add_files("yxml.c")
  18. add_headerfiles("yxml.h")
  19. add_includedirs(".")
  20. if is_plat("windows") and is_kind("shared") then
  21. add_rules("utils.symbols.export_all")
  22. end
  23. ]])
  24. import("package.tools.xmake").install(package)
  25. end)
  26. on_test(function (package)
  27. assert(package:has_cfuncs("yxml_init", {includes = "yxml.h"}))
  28. end)