Add rlottie (#1846)
* add rlottie * fix openssl patches sha256 error * lock dependencies version of rlottie * Revert "fix openssl patches sha256 error" This reverts commitpull/1856/head14a2811259
. * fix error in tests of stb * fix different sha256 for different sources of pixman * temporarily disable pixman * add patch for rlottie * disable platform cross for rlottie * fix error of rapidjson in windows-arm * Use string.serialize() instead of string.dump() * disable wasm shared library * disable wasm shared lib for pixman and freetype * fix install dir error of rlottie * fix endian detect error of rapidjson in rlottie * fix some error of rlottie * fix endian error in win-arm of rapidjson * add wasm patch for rlottie * fix patch file error * fix patch file error * fix arm build error * use pixman in xmake-repo * set cxx standard for rlottie * Update xmake.lua * Update xmake.lua * revert Android and iOS support for pixman * remove __declspec(dllimport) for static build * fix a typo error * update rlottie * update rlottie * Revert "use pixman in xmake-repo" This reverts commit442563f8e8
. * fix revert error --------- Co-authored-by: ruki <waruqi@gmail.com>
parent
0ad81951a7
commit
75a29c28af
6 changed files with 89 additions and 5 deletions
@ -0,0 +1,12 @@ |
||||
diff --git a/src/vector/vrle.cpp b/src/vector/vrle.cpp
|
||||
index c7a520f5..379f8eda 100644
|
||||
--- a/src/vector/vrle.cpp
|
||||
+++ b/src/vector/vrle.cpp
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <array>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
+#include <limits>
|
||||
#include <vector>
|
||||
#include "vdebug.h"
|
||||
#include "vglobal.h"
|
@ -0,0 +1,52 @@ |
||||
package("rlottie") |
||||
set_homepage("https://github.com/Samsung/rlottie") |
||||
set_description("A platform independent standalone library that plays Lottie Animation. ") |
||||
|
||||
add_urls("https://github.com/Samsung/rlottie/archive/refs/tags/v$(version).tar.gz", |
||||
"https://github.com/Samsung/rlottie.git") |
||||
|
||||
add_versions("0.1", "319d640f094f747e09177df59ca498f0df80c779ba789eeb1fc35da5a1c93414") |
||||
add_versions("0.2", "030ccbc270f144b4f3519fb3b86e20dd79fb48d5d55e57f950f12bab9b65216a") |
||||
add_patches("0.2", path.join(os.scriptdir(), "patches", "0.2", "limit.diff"), "6dc1c00c6ccad770586ec9d84f24d6c35e35dd624df877a71bb5c7bcc32831e9") |
||||
add_configs("module", {description = "Enable LOTTIE MODULE SUPPORT", default = true, type = "boolean"}) |
||||
add_configs("thread", {description = "Enable LOTTIE THREAD SUPPORT", default = true, type = "boolean"}) |
||||
add_configs("cache", {description = "Enable LOTTIE CACHE SUPPORT", default = true, type = "boolean"}) |
||||
add_configs("ccache", {description = "Enable LOTTIE CCACHE SUPPORT", default = false, type = "boolean"}) |
||||
add_configs("asan", {description = "Compile with asan", default = false, type = "boolean"}) |
||||
|
||||
if is_plat("wasm") then |
||||
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) |
||||
end |
||||
|
||||
add_deps("cmake") |
||||
add_deps("freetype", {configs = {zlib = false}}) |
||||
add_deps("rapidjson ~1.1.0", "stb 2019.02.07") |
||||
|
||||
add_links("rlottie") |
||||
on_install("windows", "linux", "macosx", "android|arm64*", "wasm", function (package) |
||||
local configs = {} |
||||
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) |
||||
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) |
||||
table.insert(configs, "-DLIB_INSTALL_DIR=" .. package:installdir("lib")) |
||||
for name, enabled in pairs(package:configs()) do |
||||
if not package:extraconf("configs", name, "builtin") then |
||||
table.insert(configs, "-DLOTTIE_" .. name:upper() .. "=" .. (enabled and "ON" or "OFF")) |
||||
end |
||||
end |
||||
if package:is_plat("wasm") then |
||||
io.replace("CMakeLists.txt", "-Wl,--no-undefined", "-Wl", {plain = true}) |
||||
elseif package:is_plat("windows") and not package:config("shared") then |
||||
io.replace("inc/rlottie.h", "#define RLOTTIE_API __declspec(dllimport)", "#define RLOTTIE_API", {plain = true}) |
||||
end |
||||
import("package.tools.cmake").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:check_cxxsnippets({test = [[ |
||||
#include "rlottie.h" |
||||
using namespace rlottie; |
||||
void test() { |
||||
rlottie::Surface surface(nullptr, 100, 100, 0); |
||||
} |
||||
]]}, {configs = {languages = "c++11"}})) |
||||
end) |
Loading…
Reference in new issue