Jelajahi Sumber

add sparse-map package (#3596)

* add sparse-map package

* disable windows arm
c8ef 1 tahun lalu
induk
melakukan
20c2906644
1 mengubah file dengan 28 tambahan dan 0 penghapusan
  1. 28 0
      packages/s/sparse-map/xmake.lua

+ 28 - 0
packages/s/sparse-map/xmake.lua

@@ -0,0 +1,28 @@
+package("sparse-map")
+
+    set_kind("library", {headeronly = true})
+    set_homepage("https://github.com/Tessil/sparse-map")
+    set_description("C++ implementation of a memory efficient hash map and hash set")
+    set_license("MIT")
+
+    add_urls("https://github.com/Tessil/sparse-map/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/Tessil/sparse-map.git")
+
+    add_versions("v0.6.2", "7020c21e8752e59d72e37456cd80000e18671c803890a3e55ae36b295eba99f6")
+
+    on_install("windows|x86", "windows|x64", "linux", "macosx", "bsd", "mingw", "msys", "android", "iphoneos", "cross", function (package)
+        os.cp("include/*", package:installdir("include"))
+    end)
+
+    on_test(function (package)
+      assert(package:check_cxxsnippets({test = [[
+          #include "tsl/sparse_map.h"
+
+          void test() {
+              tsl::sparse_map<int, int> map = {{1, 1}, {2, 1}, {3, 1}};
+              for(auto it = map.begin(); it != map.end(); ++it) {
+                  it.value() = 2;
+              }
+          }
+      ]]}, {configs = {languages = "cxx11"}}))
+  end)