Skip to content

Commit

Permalink
lerc: add package (#2777)
Browse files Browse the repository at this point in the history
  • Loading branch information
star-hengxing authored Nov 2, 2023
1 parent 56adc01 commit f099d11
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions packages/l/lerc/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package("lerc")
set_homepage("https://github.com/esri/lerc")
set_description("Limited Error Raster Compression")
set_license("Apache-2.0")

add_urls("https://github.com/Esri/lerc/archive/refs/tags/$(version).tar.gz",
"https://github.com/Esri/lerc.git")

add_versions("v4.0.0", "91431c2b16d0e3de6cbaea188603359f87caed08259a645fd5a3805784ee30a0")

add_deps("cmake")

on_install(function (package)
local configs = {}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
if package:config("shared") then
table.insert(configs, "-DBUILD_SHARED_LIBS=ON")
else
table.insert(configs, "-DBUILD_SHARED_LIBS=OFF")
if package:is_plat("windows", "mingw") then
package:add("defines", "LERC_STATIC")
end
end
import("package.tools.cmake").install(package, configs)
end)

on_test(function (package)
assert(package:has_cfuncs("lerc_computeCompressedSize", {includes = "Lerc_c_api.h"}))
end)

0 comments on commit f099d11

Please sign in to comment.