xmake.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233
  1. package("ls-qpack")
  2. set_homepage("https://github.com/litespeedtech/ls-qpack")
  3. set_description("QPACK compression library for use with HTTP/3")
  4. set_license("MIT")
  5. add_urls("https://github.com/litespeedtech/ls-qpack/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/litespeedtech/ls-qpack.git")
  7. add_versions("v2.5.4", "56b96190a1943d75ef8d384b13cd4592a72e3e2d84284f78d7f8adabbc717f3e")
  8. add_versions("v2.5.3", "075a05efee27961eac5ac92a12a6e28a61bcd6c122a0276938ef993338577337")
  9. add_patches("v2.5.3", path.join(os.scriptdir(), "patches", "v2.5.3", "fix-cmake-install.patch"), "7d819b620b5e2bd34ef58a91bf20d882883c7525def9f9f80313b64cba5e5239")
  10. if not is_plat("windows") then
  11. add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
  12. end
  13. add_deps("cmake")
  14. add_deps("xxhash")
  15. on_install("windows", "linux", "macosx", "android", "iphoneos", function (package)
  16. local configs = {"-DLSQPACK_TESTS=OFF", "-DLSQPACK_BIN=OFF", "-DLSQPACK_XXH=OFF",}
  17. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  18. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  19. if package:is_plat("windows") and package:config("shared") then
  20. table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON")
  21. end
  22. import("package.tools.cmake").install(package, configs, {packagedeps = "xxhash"})
  23. end)
  24. on_test(function (package)
  25. assert(package:has_cfuncs("lsqpack_enc_init", {includes = "lsqpack.h"}))
  26. end)