mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-21 22:32:29 +00:00
stm32/wpan: move linker file into pkg
This commit is contained in:
parent
d43417e97c
commit
49333ce6ad
@ -1,4 +1,5 @@
|
|||||||
use std::env;
|
use std::path::PathBuf;
|
||||||
|
use std::{env, fs};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
match env::vars()
|
match env::vars()
|
||||||
@ -10,6 +11,16 @@ fn main() {
|
|||||||
Err(GetOneError::None) => panic!("No stm32xx Cargo feature enabled"),
|
Err(GetOneError::None) => panic!("No stm32xx Cargo feature enabled"),
|
||||||
Err(GetOneError::Multiple) => panic!("Multiple stm32xx Cargo features enabled"),
|
Err(GetOneError::Multiple) => panic!("Multiple stm32xx Cargo features enabled"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let out_dir = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
|
||||||
|
|
||||||
|
// ========
|
||||||
|
// stm32wb tl_mbox link sections
|
||||||
|
|
||||||
|
let out_file = out_dir.join("tl_mbox.x").to_string_lossy().to_string();
|
||||||
|
fs::write(out_file, fs::read_to_string("tl_mbox.x.in").unwrap()).unwrap();
|
||||||
|
println!("cargo:rustc-link-search={}", out_dir.display());
|
||||||
|
println!("cargo:rerun-if-changed=tl_mbox.x.in");
|
||||||
}
|
}
|
||||||
|
|
||||||
enum GetOneError {
|
enum GetOneError {
|
||||||
|
@ -911,16 +911,6 @@ fn main() {
|
|||||||
println!("cargo:rustc-cfg={}x{}", &chip_name[..9], &chip_name[10..11]);
|
println!("cargo:rustc-cfg={}x{}", &chip_name[..9], &chip_name[10..11]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========
|
|
||||||
// stm32wb tl_mbox link sections
|
|
||||||
|
|
||||||
if chip_name.starts_with("stm32wb") {
|
|
||||||
let out_file = out_dir.join("tl_mbox.x").to_string_lossy().to_string();
|
|
||||||
fs::write(out_file, fs::read_to_string("tl_mbox.x.in").unwrap()).unwrap();
|
|
||||||
println!("cargo:rustc-link-search={}", out_dir.display());
|
|
||||||
println!("cargo:rerun-if-changed=tl_mbox.x.in");
|
|
||||||
}
|
|
||||||
|
|
||||||
// =======
|
// =======
|
||||||
// Features for targeting groups of chips
|
// Features for targeting groups of chips
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user