Skip to content

Commit

Permalink
Define has_<memory_region>_region for memory regions
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoernQ committed Dec 18, 2024
1 parent 321a5bd commit ac4b839
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions esp-metadata/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ impl Config {

// Define env-vars for all memory regions
for memory in self.memory() {
println!("cargo:rustc-cfg=has_{}_region", memory.name.to_lowercase());

println!(
"cargo::rustc-env=REGION-{}-START={}",
memory.name.to_uppercase(),
Expand Down Expand Up @@ -276,5 +278,11 @@ fn define_all_possible_symbols() {
// https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-check-cfg
println!("cargo:rustc-check-cfg=cfg({})", symbol);
}
for memory in config.memory() {
println!(
"cargo:rustc-check-cfg=cfg(has_{}_region)",
memory.name.to_lowercase()
);
}
}
}

0 comments on commit ac4b839

Please sign in to comment.