add tinyexr and jansson (#1035)
* add tinyexr * add jansson * update drogon * fix jansson and libfive * fix tinyexr * fix libfive * improve libtins * update libjpeg-turbopull/1037/head
parent
892a4c18b2
commit
7b6c23bcb0
7 changed files with 78 additions and 15 deletions
@ -0,0 +1,23 @@ |
||||
package("jansson") |
||||
|
||||
set_homepage("https://github.com/akheron/jansson") |
||||
set_description("C library for encoding, decoding and manipulating JSON data") |
||||
set_license("MIT") |
||||
|
||||
add_urls("https://github.com/akheron/jansson/releases/download/v$(version)/jansson-$(version).tar.gz") |
||||
add_versions("2.14", "5798d010e41cf8d76b66236cfb2f2543c8d082181d16bc3085ab49538d4b9929") |
||||
|
||||
add_deps("cmake") |
||||
on_install("windows", "macosx", "linux", "mingw", function (package) |
||||
local configs = {"-DJANSSON_EXAMPLES=OFF", "-DJANSSON_BUILD_DOCS=OFF", "-DJANSSON_WITHOUT_TESTS=ON"} |
||||
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) |
||||
table.insert(configs, "-DJANSSON_BUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) |
||||
if package:is_plat("windows") then |
||||
table.insert(configs, "-DJANSSON_STATIC_CRT=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) |
||||
end |
||||
import("package.tools.cmake").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("json_loads", {includes = "jansson.h"})) |
||||
end) |
@ -0,0 +1,30 @@ |
||||
package("tinyexr") |
||||
|
||||
set_homepage("https://github.com/syoyo/tinyexr/") |
||||
set_description("Tiny OpenEXR image loader/saver library") |
||||
set_license("BSD-3-Clause") |
||||
|
||||
add_urls("https://github.com/syoyo/tinyexr/archive/refs/tags/$(version).tar.gz", |
||||
"https://github.com/syoyo/tinyexr.git") |
||||
add_versions("v1.0.1", "4dbbd8c7d17597ad557518de5eb923bd02683d26d0de765f9224e8d57d121677") |
||||
|
||||
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) |
||||
|
||||
add_deps("cmake", "miniz") |
||||
on_install(function (package) |
||||
io.writefile("xmake.lua", [[ |
||||
add_rules("mode.debug", "mode.release") |
||||
add_requires("miniz") |
||||
target("tinyexr") |
||||
set_kind("static") |
||||
set_languages("c++11") |
||||
add_files("tinyexr.cc") |
||||
add_headerfiles("tinyexr.h") |
||||
add_packages("miniz") |
||||
]]) |
||||
import("package.tools.xmake").install(package) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cxxfuncs("IsEXR", {includes = "tinyexr.h"})) |
||||
end) |
Loading…
Reference in new issue