Skip to content

Commit

Permalink
libosdp-sys: Release v3.0.2
Browse files Browse the repository at this point in the history
Signed-off-by: Siddharth Chandrasekaran <[email protected]>
  • Loading branch information
sidcha committed Mar 9, 2024
1 parent 89630cf commit c5dc699
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion libosdp-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libosdp-sys"
version = "3.0.1"
version = "3.0.2"
edition = "2021"
authors = ["Siddharth Chandrasekaran <[email protected]>"]
description = "Sys crate for https://github.com/goToMain/libosdp"
Expand Down
20 changes: 14 additions & 6 deletions libosdp-sys/build.rs
Original file line number Diff line number Diff line change
@@ -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<T> = anyhow::Result<T, anyhow::Error>;

fn path_join(root: &str, path: &str) -> String {
Expand Down Expand Up @@ -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)
}

Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit c5dc699

Please sign in to comment.