esp-hal/esp-storage/build.rs
Dániel Buga 692a768b3a
Introduce esp-metadata-generated (#3754)
* Move macros to new crate

* Generate a single file

* Pre-generate esp-metadata-generated

* Move saving code to xtask

* Format with both rustfmt and prettyplease

* Fix doc build

* Unhide macros

* Fix doc string

* Update semver-check baseline
2025-07-07 15:37:05 +00:00

19 lines
600 B
Rust

fn main() -> Result<(), String> {
if cfg!(feature = "esp32") {
match std::env::var("OPT_LEVEL") {
Ok(level) if std::env::var("CI").is_err() => {
if level != "2" && level != "3" && level != "s" {
Err(format!(
"Building esp-storage for ESP32 needs optimization level 2, 3 or s - yours is {level}. See https://github.com/esp-rs/esp-storage"
))
} else {
Ok(())
}
}
_ => Ok(()),
}
} else {
Ok(())
}
}