From c5dc6991505591f2a17a105e6cb566f8f0b2f42d Mon Sep 17 00:00:00 2001 From: Siddharth Chandrasekaran Date: Sat, 9 Mar 2024 10:01:34 +0100 Subject: [PATCH] libosdp-sys: Release v3.0.2 Signed-off-by: Siddharth Chandrasekaran --- libosdp-sys/Cargo.toml | 2 +- libosdp-sys/build.rs | 20 ++++++++++++++------ libosdp-sys/vendor | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/libosdp-sys/Cargo.toml b/libosdp-sys/Cargo.toml index f7d2178..ece019f 100644 --- a/libosdp-sys/Cargo.toml +++ b/libosdp-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libosdp-sys" -version = "3.0.1" +version = "3.0.2" edition = "2021" authors = ["Siddharth Chandrasekaran "] description = "Sys crate for https://github.com/goToMain/libosdp" diff --git a/libosdp-sys/build.rs b/libosdp-sys/build.rs index c4901ee..c052bcd 100644 --- a/libosdp-sys/build.rs +++ b/libosdp-sys/build.rs @@ -1,10 +1,10 @@ +use anyhow::Context; +use build_target::Os; use std::{ borrow::BorrowMut, path::{Path, PathBuf}, process::Command, }; -use anyhow::Context; -use build_target::Os; type Result = anyhow::Result; fn path_join(root: &str, path: &str) -> String { @@ -103,8 +103,10 @@ fn main() -> Result<()> { .warnings(true) .include(&out_dir); - if Os::target().unwrap() != Os::Windows { - println!("Got here!"); + if std::env::var("WIN_WERROR").is_err() && Os::target().unwrap() != Os::Windows { + // TODO: Windows builds warn about various things which are legitimate + // in other platforms. Over time, we need to assess each case and + // handle it the way Windows likes us to do them and then remove this. build = build.warnings_into_errors(true) } @@ -134,11 +136,17 @@ fn main() -> Result<()> { } if cfg!(feature = "packet_trace") { - build = build.define("CONFIG_OSDP_PACKET_TRACE", "1"); + build = build + .define("CONFIG_OSDP_PACKET_TRACE", "1") + .file("vendor/utils/src/pcap_gen.c") + .file("vendor/src/osdp_pcap.c"); } if cfg!(feature = "data_trace") { - build = build.define("CONFIG_OSDP_DATA_TRACE", "1"); + build = build + .define("CONFIG_OSDP_DATA_TRACE", "1") + .file("vendor/utils/src/pcap_gen.c") + .file("vendor/src/osdp_pcap.c"); } build.compile("libosdp.a"); diff --git a/libosdp-sys/vendor b/libosdp-sys/vendor index 17a56c2..4396c74 160000 --- a/libosdp-sys/vendor +++ b/libosdp-sys/vendor @@ -1 +1 @@ -Subproject commit 17a56c263ee82b442931ee5e08a15a071dc01241 +Subproject commit 4396c74621007a733fcc13811411cf42321a893f