Skip to content

Commit 93a5324

Browse files
emhash: update to v1.0.1 & clean up (#8663)
* emhash: update to v1.0.1 & clean up * add cmake * Add cmake config option and modify dependencies Added cmake configuration option and conditional dependency. --------- Co-authored-by: star9029 <hengxings783@gmail.com>
1 parent 11adc99 commit 93a5324

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

packages/e/emhash/xmake.lua

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,41 @@
11
package("emhash")
22
set_kind("library", {headeronly = true})
33
set_homepage("https://github.com/ktprime/emhash")
4-
set_description("Fast and memory efficient c++ flat hash map/set")
4+
set_description("Fast and memory efficient c++ flat hash table/map/set")
55
set_license("MIT")
66

7-
add_urls("https://github.com/ktprime/emhash.git")
8-
add_versions("2024.06.01", "3efa77ef32786a033b379071fe8af3dc705736ca")
9-
add_versions("2025.03.19", "0a3107222b4f1d2f3286fb84c2d468ea5ec50373")
10-
add_versions("2025.03.24", "beae64cf1ef9e2be04923942aa457f729d105d04")
7+
add_urls("https://github.com/ktprime/emhash/archive/refs/tags/$(version).tar.gz",
8+
"https://github.com/ktprime/emhash.git")
9+
10+
add_versions("v1.0.1", "dbcce726c5ccce4a260a2c5ca9aa239e4d6109aacb3b5097ebfa465247708a7b")
11+
add_versions("v1.0.0", "9de79897a94e8c2545a401bb441ee6f6c293124e46bf9cf3023be6b1632e708b")
12+
13+
add_configs("cmake", {description = "Use cmake build system", default = false, type = "boolean"})
14+
15+
on_load(function (package)
16+
if package:config("cmake") then
17+
package:add("deps", "cmake")
18+
end
19+
end)
1120

1221
on_install(function (package)
13-
os.cp("*.hpp", package:installdir("include"))
22+
if package:config("cmake") then
23+
import("package.tools.cmake").install(package, {"-DWITH_BENCHMARKS=OFF"})
24+
else
25+
os.cp("*.hpp", package:installdir("include"))
26+
end
1427
end)
1528

1629
on_test(function (package)
1730
assert(package:check_cxxsnippets({test = [[
1831
void test() {
1932
emhash5::HashMap<int, int> m1(4);
33+
m1.reserve(100);
34+
emhash5::HashMap<int, std::string> m2 = {
35+
{1, "foo"},
36+
{3, "bar"},
37+
{2, "baz"},
38+
};
2039
}
2140
]]}, {configs = {languages = "c++11"}, includes = "hash_table5.hpp"}))
2241
end)

0 commit comments

Comments
 (0)