esp-hal/esp-storage/build.rs
Björn Quentin 60e4b882ef
Add esp-storage to esp-hal repo (#1627)
* Add esp-storage to esp-hal repo

* Include needed feature to lint esp-storage

* Don't lint esp-wifi for now

* Remove redundant copies of license texts

* Try `git-fetch-with-cli`

* Fix esp-pacs URL

* git-fetch-with-cli, again

* desperately trying
2024-05-27 15:28:05 +00:00

22 lines
710 B
Rust

fn main() -> Result<(), String> {
// Ensure that only a single chip is specified
esp_build::assert_unique_used_features!(
"esp32", "esp32c2", "esp32c3", "esp32c6", "esp32h2", "esp32p4", "esp32s2", "esp32s3"
);
if cfg!(feature = "esp32") {
match std::env::var("OPT_LEVEL") {
Ok(level) => {
if level != "2" && level != "3" {
Err(format!("Building esp-storage for ESP32 needs optimization level 2 or 3 - yours is {}. See https://github.com/esp-rs/esp-storage", level))
} else {
Ok(())
}
}
Err(_err) => Ok(()),
}
} else {
Ok(())
}
}