|
@@ -7,6 +7,7 @@ package("iguana")
|
|
|
add_urls("https://github.com/qicosmos/iguana/archive/refs/tags/$(version).tar.gz",
|
|
|
"https://github.com/qicosmos/iguana.git")
|
|
|
|
|
|
+ add_versions("1.0.6", "cfacf1cce4ebe49b947ec823f93a23c2a7fd220f67f6847e9f449e7c469deb9e")
|
|
|
add_versions("1.0.5", "b7a7385c49574a60f9f6bf887c1addbc08f557a0117bf18cf7eec532ac2536b1")
|
|
|
add_versions("1.0.4", "b584cd26e65902a14a3a349ebc480beb7b4502fd5a5ffa3cb7c6102d857958b1")
|
|
|
add_versions("v1.0.3", "7dcb21a36bd64a63a9ea857f3563ac61e965c49ec60ad7b99a2bfb9192f3e4c3")
|
|
@@ -23,17 +24,19 @@ package("iguana")
|
|
|
languages = "c++20"
|
|
|
end
|
|
|
|
|
|
- assert(package:check_cxxsnippets({test = [[
|
|
|
+ local reflection_macro = package:version():ge("1.0.6") and "YLT_REFL" or "REFLECTION"
|
|
|
+ local snippets = string.format([[
|
|
|
#include <iguana/json_reader.hpp>
|
|
|
struct some_obj {
|
|
|
std::string_view name;
|
|
|
iguana::numeric_str age;
|
|
|
};
|
|
|
- REFLECTION(some_obj, name, age);
|
|
|
+ %s(some_obj, name, age);
|
|
|
void test() {
|
|
|
some_obj obj;
|
|
|
std::string_view str = "{\"name\":\"tom\", \"age\":20}";
|
|
|
iguana::from_json(obj, str);
|
|
|
}
|
|
|
- ]]}, {configs = {languages = languages}}))
|
|
|
+ ]], reflection_macro)
|
|
|
+ assert(package:check_cxxsnippets({test = snippets}, {configs = {languages = languages}}))
|
|
|
end)
|