yoga: add package (#2788)
parent
fadf2bd884
commit
6b5d2928a0
1 changed files with 25 additions and 0 deletions
@ -0,0 +1,25 @@ |
||||
package("yoga") |
||||
set_homepage("https://yogalayout.com/") |
||||
set_description("Yoga is a cross-platform layout engine which implements Flexbox. Follow https://twitter.com/yogalayout for updates.") |
||||
set_license("MIT") |
||||
|
||||
add_urls("https://github.com/facebook/yoga/archive/refs/tags/$(version).tar.gz", |
||||
"https://github.com/facebook/yoga.git") |
||||
|
||||
add_versions("v2.0.1", "4c80663b557027cdaa6a836cc087d735bb149b8ff27cbe8442fc5e09cec5ed92") |
||||
|
||||
add_configs("shared", {description = "Build shared binaries", default = false, type = "boolean", readonly = true}) |
||||
|
||||
add_deps("cmake") |
||||
|
||||
on_install(function (package) |
||||
local configs = {} |
||||
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) |
||||
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) |
||||
io.replace("CMakeLists.txt", "add_subdirectory(tests)", "", {plain = true}) |
||||
import("package.tools.cmake").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("YGNodeNew", {includes = "yoga/Yoga.h"})) |
||||
end) |
Loading…
Reference in new issue