xmake.lua 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package("parallel-hashmap")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://greg7mdp.github.io/parallel-hashmap/")
  4. set_description("A family of header-only, very fast and memory-friendly hashmap and btree containers.")
  5. set_license("Apache-2.0")
  6. add_urls("https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/greg7mdp/parallel-hashmap.git")
  8. add_versions("v1.3.12","0cc203144321924cfbfcc401f42d8204c0dd24e2760c7a1c091baa16d9777c08")
  9. add_versions("1.37", "2ac652be0552fcb53a1163c08c1f28f29f0756594fcc587eebb4d8b363153709")
  10. add_versions("1.35", "308ab6f92e4c6f49304562e352890cf7140de85ce723c097e74fbdec88e0e1ce")
  11. add_versions("1.34", "da4939f5948229abe58acc833b111862411d45669310239b8a163bb73d0197aa")
  12. add_versions("1.33", "f6e4d0508c4d935fa25dcbaec63fbe0d7503435797e275ec109e8a3f1462a4cd")
  13. add_deps("cmake")
  14. on_install(function (package)
  15. local configs = {
  16. "-DPHMAP_BUILD_TESTS=OFF",
  17. "-DPHMAP_BUILD_EXAMPLES=OFF",
  18. }
  19. import("package.tools.cmake").install(package, configs)
  20. end)
  21. on_test(function(package)
  22. assert(package:check_cxxsnippets({
  23. test = [[
  24. #include <iostream>
  25. #include <string>
  26. #include <parallel_hashmap/phmap.h>
  27. using phmap::flat_hash_map;
  28. static void test() {
  29. flat_hash_map<std::string, std::string> email = {
  30. { "tom", "[email protected]"},
  31. { "jeff", "[email protected]"},
  32. { "jim", "[email protected]"}
  33. };
  34. for (const auto& n : email)
  35. std::cout << n.first << "'s email is: " << n.second << "\n";
  36. email["bill"] = "[email protected]";
  37. std::cout << "bill's email is: " << email["bill"] << "\n";
  38. }
  39. ]]
  40. }, {configs = {languages = "c++11"}}))
  41. end)