diff options
| author | Dario Nieuwenhuis <[email protected]> | 2021-03-29 22:28:36 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2021-03-29 22:28:36 +0200 |
| commit | d938b95430d543d8a97e611642ef09d803b7bdc1 (patch) | |
| tree | 3805f3153072cf7329b3b2c45b296c84e8847c2d /embassy-rp/build.rs | |
| parent | 4371302da87f7fad4649c0ef4eade9432dc94529 (diff) | |
rp: add precompiled boot2 to avoid depending on gcc
Diffstat (limited to 'embassy-rp/build.rs')
| -rw-r--r-- | embassy-rp/build.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/embassy-rp/build.rs b/embassy-rp/build.rs new file mode 100644 index 000000000..bc59ea23b --- /dev/null +++ b/embassy-rp/build.rs | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | use std::fs::{self, File}; | ||
| 2 | use std::io::Write; | ||
| 3 | use std::path::{Path, PathBuf}; | ||
| 4 | use std::{env, ffi::OsStr}; | ||
| 5 | |||
| 6 | fn main() { | ||
| 7 | // Put the linker script somewhere the linker can find it | ||
| 8 | let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); | ||
| 9 | let link_x = include_bytes!("link-rp.x.in"); | ||
| 10 | let mut f = File::create(out.join("link-rp.x")).unwrap(); | ||
| 11 | f.write_all(link_x).unwrap(); | ||
| 12 | |||
| 13 | println!("cargo:rustc-link-search={}", out.display()); | ||
| 14 | |||
| 15 | println!("cargo:rerun-if-changed=build.rs"); | ||
| 16 | println!("cargo:rerun-if-changed=link-rp.x.in"); | ||
| 17 | } | ||
