xmake.lua 1.3 KB

123456789101112131415161718192021222324252627282930
  1. package("libsais")
  2. set_homepage("https://github.com/IlyaGrebnov/libsais")
  3. set_description("libsais is a library for linear time suffix array, longest common prefix array and burrows wheeler transform construction based on induced sorting algorithm.")
  4. set_license("Apache-2.0")
  5. add_urls("https://github.com/IlyaGrebnov/libsais/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/IlyaGrebnov/libsais.git")
  7. add_versions("v2.7.3", "45d37dc12975c4d40db786f322cd6dcfd9f56a8f23741205fcd0fca6ec0bf246")
  8. add_versions("v2.7.1", "5f459ad90cd007c30aaefb7d122bba2a4307ea02915c56381be4b331cca92545")
  9. on_install(function (package)
  10. local configs = {}
  11. io.writefile("xmake.lua", [[
  12. add_rules("mode.release", "mode.debug")
  13. target("libsais")
  14. set_kind("$(kind)")
  15. add_files("src/*.c")
  16. add_includedirs("include")
  17. add_headerfiles("include/(*.h)")
  18. add_headerfiles("src/(*.h)")
  19. ]])
  20. if package:config("shared") then
  21. configs.kind = "shared"
  22. end
  23. import("package.tools.xmake").install(package, configs)
  24. end)
  25. on_test(function (package)
  26. assert(package:has_cfuncs("libsais_create_ctx", {includes = "libsais.h"}))
  27. end)