xmake.lua 835 B

123456789101112131415161718192021222324
  1. package("orangeduck_mpc")
  2. set_homepage("https://github.com/orangeduck/mpc")
  3. set_description("A Parser Combinator library for C")
  4. add_urls("https://github.com/orangeduck/mpc/archive/refs/tags/$(version).tar.gz",
  5. "https://github.com/orangeduck/mpc.git")
  6. add_versions("0.9.0", "da6e798accec57d7b0512ecc38adc151961adefde09811c1c25ee993a653e47c")
  7. on_install(function (package)
  8. io.writefile("xmake.lua", [[
  9. add_rules("mode.debug", "mode.release")
  10. target("mpc")
  11. set_kind("static")
  12. add_files("mpc.c")
  13. add_headerfiles("mpc.h")
  14. ]])
  15. local configs = {}
  16. import("package.tools.xmake").install(package, configs)
  17. end)
  18. on_test(function (package)
  19. assert(package:has_cfuncs("mpc_new", {includes = "mpc.h"}))
  20. end)