xmake.lua 1.0 KB

12345678910111213141516171819202122
  1. package("marisa")
  2. set_homepage("https://github.com/s-yata/marisa-trie")
  3. set_description("Matching Algorithm with Recursively Implemented StorAge.")
  4. add_urls("https://github.com/s-yata/marisa-trie/archive/$(version).zip")
  5. add_urls("https://github.com/s-yata/marisa-trie.git")
  6. add_versions("v0.2.6", "8dc0b79ff9948be80fd09df6d2cc70134367339ec7d6496857bc47cf421df1af")
  7. add_deps("cmake")
  8. on_install("windows", "mingw", "linux", "macosx", "bsd", function (package)
  9. os.cp(path.join(package:scriptdir(), "port", "CMakeLists.txt"), "CMakeLists.txt")
  10. local configs = {"-DENABLE_TESTS=OFF"}
  11. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  12. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  13. import("package.tools.cmake").install(package, configs)
  14. end)
  15. on_test(function (package)
  16. assert(package:has_cxxtypes("marisa::Trie", {configs = {languages = "c++11"}, includes = "marisa.h"}))
  17. end)