diff options
author | Determinant <ted.sybil@gmail.com> | 2017-09-21 15:50:48 -0400 |
---|---|---|
committer | Determinant <ted.sybil@gmail.com> | 2017-09-21 15:50:48 -0400 |
commit | f6340e4d1f6bd9356830e0c73f0bd813912ea2cc (patch) | |
tree | ab6b1d658f1a03be0156e5354f8ee84ba4ec22bb /build.rs |
init
Diffstat (limited to 'build.rs')
-rw-r--r-- | build.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..34363d2 --- /dev/null +++ b/build.rs @@ -0,0 +1,17 @@ +use std::env; +use std::fs::File; +use std::io::Write; +use std::path::PathBuf; + +pub fn main() { + // Put the linker script somewhere the linker can find it + let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); + File::create(out.join("memory.x")) + .unwrap() + .write_all(include_bytes!("memory.x")) + .unwrap(); + println!("cargo:rustc-link-search={}", out.display()); + + println!("cargo:rerun-if-changed=build.rs"); + println!("cargo:rerun-if-changed=memory.x"); +} |