diff options
| author | Caleb Jamison <[email protected]> | 2024-08-07 23:20:26 -0400 |
|---|---|---|
| committer | Caleb Jamison <[email protected]> | 2024-08-08 21:35:21 -0400 |
| commit | b185e02a42ad751ec6c31ffa6a1b87503f15489d (patch) | |
| tree | 0f0c66747267d24d95b5957b22db7e5c525cb00e /embassy-rp/build.rs | |
| parent | 891c5ee10584cd990dad529e3506fe1328e4e69d (diff) | |
Initial rp235x support
Examples have been run, but there is not yet a test suite.
Diffstat (limited to 'embassy-rp/build.rs')
| -rw-r--r-- | embassy-rp/build.rs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/embassy-rp/build.rs b/embassy-rp/build.rs index f41ccd220..3216a3826 100644 --- a/embassy-rp/build.rs +++ b/embassy-rp/build.rs | |||
| @@ -4,14 +4,16 @@ use std::io::Write; | |||
| 4 | use std::path::PathBuf; | 4 | use std::path::PathBuf; |
| 5 | 5 | ||
| 6 | fn main() { | 6 | fn main() { |
| 7 | // Put the linker script somewhere the linker can find it | 7 | if env::var("CARGO_FEATURE_RP2040").is_ok() { |
| 8 | let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); | 8 | // Put the linker script somewhere the linker can find it |
| 9 | let link_x = include_bytes!("link-rp.x.in"); | 9 | let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); |
| 10 | let mut f = File::create(out.join("link-rp.x")).unwrap(); | 10 | let link_x = include_bytes!("link-rp.x.in"); |
| 11 | f.write_all(link_x).unwrap(); | 11 | let mut f = File::create(out.join("link-rp.x")).unwrap(); |
| 12 | f.write_all(link_x).unwrap(); | ||
| 12 | 13 | ||
| 13 | println!("cargo:rustc-link-search={}", out.display()); | 14 | println!("cargo:rustc-link-search={}", out.display()); |
| 14 | 15 | ||
| 15 | println!("cargo:rerun-if-changed=build.rs"); | 16 | println!("cargo:rerun-if-changed=build.rs"); |
| 16 | println!("cargo:rerun-if-changed=link-rp.x.in"); | 17 | println!("cargo:rerun-if-changed=link-rp.x.in"); |
| 18 | } | ||
| 17 | } | 19 | } |
