parent
8aa0f0f329
commit
b4591998c7
2 changed files with 50 additions and 0 deletions
@ -0,0 +1,12 @@ |
||||
diff --git a/include/mapbox/eternal.hpp b/include/mapbox/eternal.hpp
|
||||
index 10c2f82..ab92ccb 100644
|
||||
--- a/include/mapbox/eternal.hpp
|
||||
+++ b/include/mapbox/eternal.hpp
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <utility>
|
||||
#include <functional>
|
||||
+#include <cstdint>
|
||||
|
||||
// GCC 4.9 compatibility
|
||||
#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ < 5
|
@ -0,0 +1,38 @@ |
||||
package("mapbox_eternal") |
||||
|
||||
set_kind("library", {headeronly = true}) |
||||
set_homepage("https://github.com/mapbox/eternal") |
||||
set_description("A C++14 compile-time/constexpr map and hash map with minimal binary footprint") |
||||
set_license("ISC") |
||||
|
||||
set_urls("https://github.com/mapbox/eternal/archive/refs/tags/$(version).tar.gz", |
||||
"https://github.com/mapbox/eternal.git") |
||||
|
||||
add_versions("v1.0.1", "7d799381b3786d0bd987eea75df2a81f581a64ee962e922a2f7a7d3d0c3d0421") |
||||
add_patches("v1.0.1", path.join(os.scriptdir(), "patches", "add_cstdint.patch"), "9a3724ec903fb9d8963ac1d144228f9b5800a102857ea80199b0251f254d89b4") |
||||
|
||||
on_install(function (package) |
||||
os.cp("include/mapbox", package:installdir("include")) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:check_cxxsnippets({test = [[ |
||||
struct Color |
||||
{ |
||||
unsigned int r, g, b, a; |
||||
}; |
||||
|
||||
constexpr auto colors = mapbox::eternal::map<mapbox::eternal::string, Color>({ |
||||
{ "red", { 255, 0, 0, 1 } }, |
||||
{ "green", { 0, 128, 0, 1 } }, |
||||
{ "yellow", { 255, 255, 0, 1 } }, |
||||
{ "white", { 255, 255, 255, 1 } }, |
||||
{ "black", { 0, 0, 0, 1 } } |
||||
}); |
||||
|
||||
void test() |
||||
{ |
||||
colors.contains("yellow"); |
||||
} |
||||
]]}, {configs = {languages = "c++14"}, includes = { "mapbox/eternal.hpp"} })) |
||||
end) |
Loading…
Reference in new issue