xmake.lua 1.8 KB

123456789101112131415161718192021222324252627282930313233
  1. package("rapidfuzz")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://rapidfuzz.github.io/rapidfuzz-cpp")
  4. set_description("Rapid fuzzy string matching in C++ using the Levenshtein Distance")
  5. set_license("MIT")
  6. add_urls("https://github.com/rapidfuzz/rapidfuzz-cpp/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/rapidfuzz/rapidfuzz-cpp.git")
  8. add_versions("v3.1.1", "5a72811a9f5a890c69cb479551c19517426fb793a10780f136eb482c426ec3c8")
  9. add_versions("v3.0.5", "e32936cc66333a12f659553b5fdd6d0c22257d32ac3b7a806ac9031db8dea5a1")
  10. add_versions("v3.0.4", "18d1c41575ceddd6308587da8befc98c85d3b5bc2179d418daffed6d46b8cb0a")
  11. add_versions("v3.0.2", "4fddce5c0368e78bd604c6b820e6be248d669754715e39b4a8a281bda4c06de1")
  12. add_deps("cmake")
  13. on_install(function (package)
  14. import("package.tools.cmake").install(package)
  15. end)
  16. on_test(function (package)
  17. assert(package:check_cxxsnippets({test = [[
  18. void test() {
  19. using rapidfuzz::fuzz::ratio;
  20. double score1 = rapidfuzz::fuzz::ratio("this is a test", "this is a test!");
  21. double score2 = rapidfuzz::fuzz::partial_ratio("this is a test", "this is a test!");
  22. double score3 = rapidfuzz::fuzz::ratio("fuzzy wuzzy was a bear", "wuzzy fuzzy was a bear");
  23. double score4 = rapidfuzz::fuzz::token_sort_ratio("fuzzy wuzzy was a bear", "wuzzy fuzzy was a bear");
  24. double score5 = rapidfuzz::fuzz::token_sort_ratio("fuzzy was a bear", "fuzzy fuzzy was a bear");
  25. double score6 = rapidfuzz::fuzz::token_set_ratio("fuzzy was a bear", "fuzzy fuzzy was a bear");
  26. }
  27. ]]},{includes = "rapidfuzz/fuzz.hpp", configs = {languages = "c++17"}}))
  28. end)