|
|
@ -3,29 +3,54 @@ package("blend2d") |
|
|
|
set_description("2D Vector Graphics Engine Powered by a JIT Compiler") |
|
|
|
set_description("2D Vector Graphics Engine Powered by a JIT Compiler") |
|
|
|
set_license("zlib") |
|
|
|
set_license("zlib") |
|
|
|
|
|
|
|
|
|
|
|
add_urls("https://github.com/blend2d/blend2d.git") |
|
|
|
set_urls("https://blend2d.com/download/blend2d-$(version).tar.gz", |
|
|
|
add_versions("2022.05.12", "84987c5f76c1b8f271e8556a4b87bcab78094c70") |
|
|
|
"https://github.com/blend2d/blend2d.git") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
add_versions("0.11.1", "f46d61b6aa477fea1a353a41f5906d4e861817ae059ed22fc6ecdd50ff859dd2") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
add_configs("jit", {description = "Enable JIT compiler support", default = true, type = "boolean"}) |
|
|
|
|
|
|
|
|
|
|
|
add_deps("cmake") |
|
|
|
add_deps("cmake") |
|
|
|
|
|
|
|
|
|
|
|
add_deps("asmjit") |
|
|
|
if is_plat("linux", "bsd") then |
|
|
|
if is_plat("linux") then |
|
|
|
|
|
|
|
add_syslinks("pthread") |
|
|
|
add_syslinks("pthread") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
on_check("windows", function (package) |
|
|
|
|
|
|
|
import("core.tool.toolchain") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local msvc = toolchain.load("msvc", {plat = package:plat(), arch = package:arch()}) |
|
|
|
|
|
|
|
if msvc and package:is_arch("arm.*") then |
|
|
|
|
|
|
|
local vs = msvc:config("vs") |
|
|
|
|
|
|
|
assert(vs and tonumber(vs) >= 2022, "package(blend2d/arm): need vs >= 2022") |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end) |
|
|
|
|
|
|
|
|
|
|
|
on_load(function (package) |
|
|
|
on_load(function (package) |
|
|
|
package:add("deps", "asmjit", {configs = {shared = package:config("shared")}}) |
|
|
|
if package:config("jit") then |
|
|
|
|
|
|
|
package:add("deps", "asmjit") |
|
|
|
|
|
|
|
end |
|
|
|
if not package:config("shared") then |
|
|
|
if not package:config("shared") then |
|
|
|
package:add("defines", "BL_STATIC") |
|
|
|
package:add("defines", "BL_STATIC") |
|
|
|
end |
|
|
|
end |
|
|
|
end) |
|
|
|
end) |
|
|
|
|
|
|
|
|
|
|
|
on_install("windows", "macosx", "linux", function (package) |
|
|
|
on_install("!iphoneos", function (package) |
|
|
|
local configs = {"-DBLEND2D_TEST=OFF", "-DBLEND2D_NO_STDCXX=0"} |
|
|
|
local configs = {} |
|
|
|
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) |
|
|
|
if package:config("jit") then |
|
|
|
|
|
|
|
table.insert(configs, "-DBLEND2D_EXTERNAL_ASMJIT=TRUE") |
|
|
|
|
|
|
|
table.insert(configs, "-DBLEND2D_NO_JIT=OFF") |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
table.insert(configs, "-DBLEND2D_NO_JIT=ON") |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) |
|
|
|
table.insert(configs, "-DBLEND2D_STATIC=" .. (package:config("shared") and "FALSE" or "TRUE")) |
|
|
|
table.insert(configs, "-DBLEND2D_STATIC=" .. (package:config("shared") and "FALSE" or "TRUE")) |
|
|
|
io.replace("CMakeLists.txt", 'include("${ASMJIT_DIR}/CMakeLists.txt")', "", {plain = true}) |
|
|
|
|
|
|
|
import("package.tools.cmake").install(package, configs, {packagedeps = "asmjit"}) |
|
|
|
local cxflags |
|
|
|
|
|
|
|
if package:is_plat("windows") and package:is_arch("arm.*") then |
|
|
|
|
|
|
|
cxflags = "-D__ARM_NEON" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
import("package.tools.cmake").install(package, configs, {cxflags = cxflags}) |
|
|
|
end) |
|
|
|
end) |
|
|
|
|
|
|
|
|
|
|
|
on_test(function (package) |
|
|
|
on_test(function (package) |
|
|
|