xmake.lua 1.5 KB

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