From c5a71a7d38ffebd7b4a00f816f3a095730e3e81d Mon Sep 17 00:00:00 2001 From: Siddharth Chandrasekaran Date: Tue, 20 Feb 2024 20:26:27 +0100 Subject: [PATCH] libosdp-sys: Don't enforce -Werror on windows builds Signed-off-by: Siddharth Chandrasekaran --- libosdp-sys/Cargo.toml | 1 + libosdp-sys/build.rs | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libosdp-sys/Cargo.toml b/libosdp-sys/Cargo.toml index 5160a3d..6990220 100644 --- a/libosdp-sys/Cargo.toml +++ b/libosdp-sys/Cargo.toml @@ -15,6 +15,7 @@ categories = ["development-tools", "embedded"] [build-dependencies] anyhow = "1.0.75" bindgen = "0.69.1" +build-target = "0.4.0" cc = "1.0.83" [features] diff --git a/libosdp-sys/build.rs b/libosdp-sys/build.rs index 33fcdf1..c4901ee 100644 --- a/libosdp-sys/build.rs +++ b/libosdp-sys/build.rs @@ -3,8 +3,8 @@ use std::{ path::{Path, PathBuf}, process::Command, }; - use anyhow::Context; +use build_target::Os; type Result = anyhow::Result; fn path_join(root: &str, path: &str) -> String { @@ -101,9 +101,13 @@ fn main() -> Result<()> { .include("vendor/include") .include("vendor/utils/include") .warnings(true) - .warnings_into_errors(true) .include(&out_dir); + if Os::target().unwrap() != Os::Windows { + println!("Got here!"); + build = build.warnings_into_errors(true) + } + let source_files = vec![ "vendor/utils/src/list.c", "vendor/utils/src/queue.c",