Skip to content

Commit

Permalink
libosdp-sys: Pull in __BARE_METAL__ target fix
Browse files Browse the repository at this point in the history
Signed-off-by: Siddharth Chandrasekaran <sidcha.dev@gmail.com>
  • Loading branch information
sidcha committed Nov 10, 2024
1 parent 6ffd7bc commit 2c6a271
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions libosdp-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ fn main() -> Result<()> {
build = build.warnings_into_errors(true)
}

let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
if target_os.is_empty() || target_os == "none" {
println!("cargo:warning=Building for bare metal target");
build = build.define("__BARE_METAL__", "1")
}

let source_files = vec![
"vendor/utils/src/list.c",
"vendor/utils/src/queue.c",
Expand Down

0 comments on commit 2c6a271

Please sign in to comment.