xmake.lua 1.5 KB

1234567891011121314151617181920212223242526272829303132
  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.3", "075a05efee27961eac5ac92a12a6e28a61bcd6c122a0276938ef993338577337")
  8. add_patches("v2.5.3", path.join(os.scriptdir(), "patches", "v2.5.3", "fix-cmake-install.patch"), "7d819b620b5e2bd34ef58a91bf20d882883c7525def9f9f80313b64cba5e5239")
  9. if not is_plat("windows") then
  10. add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
  11. end
  12. add_deps("cmake")
  13. add_deps("xxhash")
  14. on_install("windows", "linux", "macosx", "android", "iphoneos", function (package)
  15. local configs = {"-DLSQPACK_TESTS=OFF", "-DLSQPACK_BIN=OFF", "-DLSQPACK_XXH=OFF",}
  16. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  17. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  18. if package:is_plat("windows") and package:config("shared") then
  19. table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON")
  20. end
  21. import("package.tools.cmake").install(package, configs, {packagedeps = "xxhash"})
  22. end)
  23. on_test(function (package)
  24. assert(package:has_cfuncs("lsqpack_enc_init", {includes = "lsqpack.h"}))
  25. end)