xmake.lua 1.1 KB

123456789101112131415161718192021222324
  1. package("cmark")
  2. set_homepage("https://github.com/commonmark/cmark")
  3. set_description("CommonMark parsing and rendering library and program in C")
  4. add_urls("https://github.com/commonmark/cmark/archive/refs/tags/$(version).tar.gz",
  5. "https://github.com/commonmark/cmark.git")
  6. add_versions("0.31.2", "f9bc5ca38bcb0b727f0056100fac4d743e768872e3bacec7746de28f5700d697")
  7. add_versions("0.31.1", "3da93db5469c30588cfeb283d9d62edfc6ded9eb0edc10a4f5bbfb7d722ea802")
  8. add_versions("0.31.0", "bbcb8f8c03b5af33fcfcf11a74e9499f20a9043200b8552f78a6e8ba76e04d11")
  9. add_deps("cmake")
  10. on_install(function (package)
  11. local configs = {}
  12. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  13. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  14. table.insert(configs, "-DBUILD_TESTING=OFF")
  15. import("package.tools.cmake").install(package, configs)
  16. end)
  17. on_test(function (package)
  18. assert(package:has_cfuncs("cmark_markdown_to_html", {includes = "cmark.h"}))
  19. end)