Skip to content

Commit

Permalink
Add build script detection for invalid features
Browse files Browse the repository at this point in the history
  • Loading branch information
MabezDev committed Oct 23, 2023
1 parent a7d5522 commit 2bd4f3e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions esp-wifi/.cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,15 @@ rustflags = [
# Enable the atomic codegen option for Xtensa
"-C", "target-feature=+s32c1i",

# tell the core library have atomics even though it's not specified in the target definition
"--cfg", "target_has_atomic_load_store",
"--cfg", 'target_has_atomic_load_store="8"',
"--cfg", 'target_has_atomic_load_store="16"',
"--cfg", 'target_has_atomic_load_store="32"',
"--cfg", 'target_has_atomic_load_store="ptr"',
# Tell the `core` library that we have atomics, even though it's not
# specified in the target definition
"--cfg", 'target_has_atomic',
"--cfg", 'target_has_atomic="8"',
"--cfg", 'target_has_atomic="16"',
"--cfg", 'target_has_atomic="32"',
Expand Down
5 changes: 5 additions & 0 deletions esp-wifi/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ fn main() -> Result<(), String> {
#[cfg(feature = "coex")]
println!("cargo:rustc-cfg=coex");

#[cfg(all(feature = "ble", feature = "esp32s2"))]
{
panic!("BLE is not supported on this target.");
}

Ok(())
}

Expand Down

0 comments on commit 2bd4f3e

Please sign in to comment.