Skip to content
This repository was archived by the owner on Nov 28, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,17 @@
//!
//! ``` ignore,no_run
//! use std::env;
//! use std::fs::File;
//! use std::io::Write;
//! use std::path::Path;
//! use std::fs;
//! use std::path::PathBuf;
//!
//! /// Put the linker script somewhere the linker can find it.
//! fn main() {
//! let out_dir = env::var("OUT_DIR").expect("No out dir");
//! let dest_path = Path::new(&out_dir);
//! let mut f = File::create(&dest_path.join("memory.x"))
//! .expect("Could not create file");
//!
//! f.write_all(include_bytes!("memory.x"))
//! .expect("Could not write file");
//!
//! println!("cargo:rustc-link-search={}", dest_path.display());
//! let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
//!
//! // Put the linker script somewhere the linker can find it.
//! fs::write(out_dir.join("memory.x"), include_bytes!("memory.x")).unwrap();
//! println!("cargo:rustc-link-search={}", out_dir.display());
//! println!("cargo:rerun-if-changed=memory.x");
//!
//! println!("cargo:rerun-if-changed=build.rs");
//! }
//! ```
Expand Down