xmake.lua 1.3 KB

12345678910111213141516171819202122232425262728
  1. package("edlib")
  2. set_homepage("http://martinsos.github.io/edlib")
  3. set_description("Lightweight, super fast C/C++ (& Python) library for sequence alignment using edit (Levenshtein) distance.")
  4. set_license("MIT")
  5. add_urls("https://github.com/Martinsos/edlib/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/Martinsos/edlib.git")
  7. add_versions("v1.2.7", "8767bc1b04a1a67282d57662e5702c4908996e96b1753b5520921ff189974621")
  8. add_configs("tools", {description = "Build tools", default = false, type = "boolean"})
  9. add_deps("cmake")
  10. on_install(function (package)
  11. local configs = {"-DBUILD_TESTING=OFF", "-DEDLIB_BUILD_EXAMPLES=OFF"}
  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, "-DEDLIB_BUILD_UTILITIES=" .. (package:config("tools") and "ON" or "OFF"))
  15. import("package.tools.cmake").install(package, configs)
  16. if package:config("shared") and package:is_plat("windows") then
  17. package:add("defines", "EDLIB_SHARED")
  18. end
  19. end)
  20. on_test(function (package)
  21. assert(package:has_cfuncs("edlibAlign", {includes = "edlib.h"}))
  22. end)