Skip to content

Commit

Permalink
Don't hardcode path to threadx dir
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpallant committed Nov 28, 2023
1 parent 3b1e6c7 commit 7cffd29
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion demo-app/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::{env, error::Error, fs, path::PathBuf};

fn main() -> Result<(), Box<dyn Error>> {
let out_dir = PathBuf::from(env::var("OUT_DIR")?);
let crate_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR")?);

// put memory layout (linker script) in the linker search path
fs::copy("memory.x", out_dir.join("memory.x"))?;
Expand All @@ -15,7 +16,8 @@ fn main() -> Result<(), Box<dyn Error>> {

// Include our ThreadX static library
println!(
"cargo:rustc-link-search=/Users/jonathan/Documents/ferrous-systems/threadx/threadx/build"
"cargo:rustc-link-search={}",
crate_dir.join("../threadx/build").display()
);
println!("cargo:rustc-link-lib=static=threadx");

Expand Down

0 comments on commit 7cffd29

Please sign in to comment.