Skip to content

Commit

Permalink
move all buildrs to new build crate
Browse files Browse the repository at this point in the history
  • Loading branch information
bradjc committed Aug 4, 2023
1 parent 224097b commit 026e8db
Show file tree
Hide file tree
Showing 21 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions runtime/build.rs → libtock_runtime_build/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ fn main() {
"Build path contains a newline, which is unsupported"
);

// Share the out dir of this crate with the actual source so we know where
// we put the linker scripts.
println!("cargo:rustc-env=LIBTOCK_RUNTIME_BUILD_OUT_DIR={}", out_dir);

// Copy all platform linker scripts to a directory where the linker can find
// them.
let paths = read_dir("layouts").unwrap();
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions libtock_runtime_build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ pub fn auto_layout() {
"Build path contains a newline, which is unsupported"
);

// Set the linker search path to the out dir of this crate where we have
// stored all of the linker files.
let runtime_build_out_dir = env!("LIBTOCK_RUNTIME_BUILD_OUT_DIR");
println!("cargo:rustc-link-search={}", runtime_build_out_dir);

// Choose the linker file we are going to use for this build. That can be
// specified by choosing a platform, where the linker file will be selected
// from `runtime/layouts`, or by explicitly setting the flash and RAM
Expand Down

0 comments on commit 026e8db

Please sign in to comment.