xmake.lua 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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("1.35", "308ab6f92e4c6f49304562e352890cf7140de85ce723c097e74fbdec88e0e1ce")
  9. add_versions("1.34", "da4939f5948229abe58acc833b111862411d45669310239b8a163bb73d0197aa")
  10. add_versions("1.33", "f6e4d0508c4d935fa25dcbaec63fbe0d7503435797e275ec109e8a3f1462a4cd")
  11. add_deps("cmake")
  12. on_install(function (package)
  13. local configs = {
  14. "-DPHMAP_BUILD_TESTS=OFF",
  15. "-DPHMAP_BUILD_EXAMPLES=OFF",
  16. }
  17. import("package.tools.cmake").install(package, configs)
  18. end)
  19. on_test(function(package)
  20. assert(package:check_cxxsnippets({
  21. test = [[
  22. #include <iostream>
  23. #include <string>
  24. #include <parallel_hashmap/phmap.h>
  25. using phmap::flat_hash_map;
  26. static void test() {
  27. flat_hash_map<std::string, std::string> email = {
  28. { "tom", "[email protected]"},
  29. { "jeff", "[email protected]"},
  30. { "jim", "[email protected]"}
  31. };
  32. for (const auto& n : email)
  33. std::cout << n.first << "'s email is: " << n.second << "\n";
  34. email["bill"] = "[email protected]";
  35. std::cout << "bill's email is: " << email["bill"] << "\n";
  36. }
  37. ]]
  38. }, {configs = {languages = "c++11"}}))
  39. end)