package An official xmake package repository https://xrepo.xmake.io/
 
 
 

34 lines
1.3 KiB

package("ordered_map")
set_kind("library", {headeronly = true})
set_homepage("https://github.com/Tessil/ordered-map")
set_description("C++ hash map and hash set which preserve the order of insertion")
set_license("MIT")
set_urls("https://github.com/Tessil/ordered-map/archive/refs/tags/$(version).tar.gz",
"https://github.com/Tessil/ordered-map.git")
add_versions("v1.0.0", "49cd436b8bdacb01d5f4afd7aab0c0d6fa57433dfc29d65f08a5f1ed1e2af26b")
on_install(function (package)
os.cp("include/tsl", package:installdir("include"))
end)
on_test(function (package)
assert(package:check_cxxsnippets({test = [[
#include <iostream>
void test()
{
tsl::ordered_map<char, int> map = {{'d', 1}, {'a', 2}, {'g', 3}};
map.insert({'b', 4});
map['h'] = 5;
map['e'] = 6;
map.erase('a');
// {d, 1} {g, 3} {b, 4} {h, 5} {e, 6}
for(const auto& key_value : map) {
std::cout << "{" << key_value.first << ", " << key_value.second << "}" << std::endl;
}
}
]]}, {configs = {languages = "c++11"}, includes = { "tsl/ordered_map.h"} }))
end)