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",