xmake.lua 1.1 KB

1234567891011121314151617181920212223242526272829
  1. package("lerc")
  2. set_homepage("https://github.com/esri/lerc")
  3. set_description("Limited Error Raster Compression")
  4. set_license("Apache-2.0")
  5. add_urls("https://github.com/Esri/lerc/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/Esri/lerc.git")
  7. add_versions("v4.0.0", "91431c2b16d0e3de6cbaea188603359f87caed08259a645fd5a3805784ee30a0")
  8. add_deps("cmake")
  9. on_install(function (package)
  10. local configs = {}
  11. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  12. if package:config("shared") then
  13. table.insert(configs, "-DBUILD_SHARED_LIBS=ON")
  14. else
  15. table.insert(configs, "-DBUILD_SHARED_LIBS=OFF")
  16. if package:is_plat("windows", "mingw") then
  17. package:add("defines", "LERC_STATIC")
  18. end
  19. end
  20. import("package.tools.cmake").install(package, configs)
  21. end)
  22. on_test(function (package)
  23. assert(package:has_cfuncs("lerc_computeCompressedSize", {includes = "Lerc_c_api.h"}))
  24. end)