From 7cffd29758f8c3501313839ba31f554cf26564aa Mon Sep 17 00:00:00 2001 From: "Jonathan Pallant (Ferrous Systems)" Date: Tue, 28 Nov 2023 10:04:05 +0000 Subject: [PATCH] Don't hardcode path to threadx dir --- demo-app/build.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/demo-app/build.rs b/demo-app/build.rs index e0323d2..18a0c11 100644 --- a/demo-app/build.rs +++ b/demo-app/build.rs @@ -7,6 +7,7 @@ use std::{env, error::Error, fs, path::PathBuf}; fn main() -> Result<(), Box> { 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"))?; @@ -15,7 +16,8 @@ fn main() -> Result<(), Box> { // 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");