From 2e6cec24c05f93115f86ce709a03e5f1dfe0cbc7 Mon Sep 17 00:00:00 2001 From: yuanchao Date: Thu, 17 Oct 2024 09:53:13 +0800 Subject: [PATCH] fix: remove dynamic libpcap --- agent/Cargo.toml | 1 + agent/build.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/agent/Cargo.toml b/agent/Cargo.toml index 29a550a578d..5ec7b62c468 100644 --- a/agent/Cargo.toml +++ b/agent/Cargo.toml @@ -143,6 +143,7 @@ tonic-build = "0.8.0" [features] enterprise = ["off_cpu", "enterprise-utils"] off_cpu = [] +dylib_pcap = [] [[bench]] name = "common" diff --git a/agent/build.rs b/agent/build.rs index dbb1d9286d8..351707e497a 100644 --- a/agent/build.rs +++ b/agent/build.rs @@ -132,7 +132,10 @@ fn set_linkage() -> Result<(), Box> { println!("cargo:rustc-link-lib=dylib=pthread"); println!("cargo:rustc-link-lib=dylib=z"); println!("cargo:rustc-link-lib=dylib=stdc++"); + #[cfg(feature = "dylib_pcap")] println!("cargo:rustc-link-lib=dylib=pcap"); + #[cfg(not(feature = "dylib_pcap"))] + println!("cargo:rustc-link-lib=static=pcap"); } "musl" => { #[cfg(target_arch = "x86_64")]