diff --git a/agent/Cargo.toml b/agent/Cargo.toml index 7cb5bcf39f2..65d1b37037b 100644 --- a/agent/Cargo.toml +++ b/agent/Cargo.toml @@ -156,6 +156,7 @@ walkdir = "2" [features] enterprise = ["extended_profile", "enterprise-utils"] extended_profile = [] +dylib_pcap = [] [[bench]] name = "common" diff --git a/agent/build.rs b/agent/build.rs index b21b81e0d47..e357f5aaa64 100644 --- a/agent/build.rs +++ b/agent/build.rs @@ -193,7 +193,10 @@ fn set_linkage() -> Result<()> { 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")]