Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
Merge #100
Browse files Browse the repository at this point in the history
100: Simplify build.rs example r=dkhayes117 a=Disasm



Co-authored-by: Vadim Kaushan <[email protected]>
  • Loading branch information
bors[bot] and Disasm authored Jul 11, 2022
2 parents 0ff428f + 65d674c commit 99303dd
Showing 1 changed file with 7 additions and 13 deletions.
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

0 comments on commit 99303dd

Please sign in to comment.