Support pcapplusplus with zstd (#5579)

* Support pcapplusplus with zstd

* zstd macro enable

---------

Co-authored-by: Aleksei Safronov <asafrnv@artis.team>
Co-authored-by: ruki <waruqi@gmail.com>
autoupdate-luau-0.652
jj683 2 weeks ago committed by GitHub
parent c03e5cbe1e
commit 52d80bcb94
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      packages/p/pcapplusplus/xmake.lua

@ -13,6 +13,7 @@ package("pcapplusplus")
add_patches("v24.09", "patches/v24.09/explicit-override.patch", "d4ff15e920ea4996f6d3105e898e42d75cfab47b7e930467442ae356a361cf25")
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
add_configs("zstd", {description = "Support compile with zstd", default = false, type = "boolean"})
add_links("Pcap++", "Packet++", "Common++")
@ -31,12 +32,19 @@ package("pcapplusplus")
add_deps("libpcap")
end
on_load(function (package)
if package:config("zstd") then
package:add("deps", "zstd")
end
end)
on_install("windows", "mingw", "linux", "macosx", "android", "bsd", function (package)
local configs = {
"-DPCAPPP_BUILD_EXAMPLES=OFF",
"-DPCAPPP_BUILD_TESTS=OFF"
}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
table.insert(configs, "-DLIGHT_PCAPNG_ZSTD=" .. (package:config("zstd") and "ON" or "OFF"))
for _, cmakefile in ipairs(os.files("**/CMakeLists.txt")) do
io.replace(cmakefile, "COMPILE_WARNING_AS_ERROR ON", "COMPILE_WARNING_AS_ERROR OFF")
end

Loading…
Cancel
Save