xmake.lua 936 B

12345678910111213141516171819202122
  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.0", "bbcb8f8c03b5af33fcfcf11a74e9499f20a9043200b8552f78a6e8ba76e04d11")
  7. add_deps("cmake")
  8. on_install(function (package)
  9. local configs = {}
  10. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  11. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  12. table.insert(configs, "-DBUILD_TESTING=OFF")
  13. import("package.tools.cmake").install(package, configs)
  14. end)
  15. on_test(function (package)
  16. assert(package:has_cfuncs("cmark_markdown_to_html", {includes = "cmark.h"}))
  17. end)