From 52d80bcb9433648fafe42baf8ef5df0a47fc4515 Mon Sep 17 00:00:00 2001 From: jj683 <87266000+jj683@users.noreply.github.com> Date: Sat, 16 Nov 2024 15:14:53 +0100 Subject: [PATCH] Support pcapplusplus with zstd (#5579) * Support pcapplusplus with zstd * zstd macro enable --------- Co-authored-by: Aleksei Safronov Co-authored-by: ruki --- packages/p/pcapplusplus/xmake.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/p/pcapplusplus/xmake.lua b/packages/p/pcapplusplus/xmake.lua index 2afada38a..ebff6a025 100644 --- a/packages/p/pcapplusplus/xmake.lua +++ b/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