feat: fixed pcap linking and added nix packages
This commit is contained in:
+7
-5
@@ -13,10 +13,8 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use fs_extra::dir::{copy, CopyOptions};
|
||||
|
||||
fn main() {
|
||||
include!("../build_freebsd.rs");
|
||||
include!("../build_common.rs");
|
||||
|
||||
if std::env::var("CARGO_CFG_TARGET_OS").unwrap() == "windows" {
|
||||
let libdir = std::env::var("SPARSE_BUILD_WINPCAP_LIBS").unwrap();
|
||||
@@ -27,8 +25,12 @@ fn main() {
|
||||
let libdir = std::env::var("SPARSE_BUILD_LIBPCAP_FREEBSD").unwrap();
|
||||
println!("cargo:rustc-link-search=native={libdir}/lib");
|
||||
println!("cargo:rustc-link-lib=static=pcap");
|
||||
} else {
|
||||
let libdir = std::env::var("SPARSE_BUILD_LIBPCAP_LINUX").unwrap();
|
||||
} else if std::env::var("CARGO_CFG_TARGET_ENV").unwrap() == "musl" {
|
||||
let libdir = std::env::var("SPARSE_BUILD_LIBPCAP_LINUX_MUSL").unwrap();
|
||||
println!("cargo:rustc-link-search=native={libdir}/lib");
|
||||
println!("cargo:rustc-link-lib=static=pcap");
|
||||
} else if std::env::var("CARGO_CFG_TARGET_ENV").unwrap() == "gnu" {
|
||||
let libdir = std::env::var("SPARSE_BUILD_LIBPCAP_LINUX_GNU").unwrap();
|
||||
println!("cargo:rustc-link-search=native={libdir}/lib");
|
||||
println!("cargo:rustc-link-lib=static=pcap");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user