From 070f199d3b48cebcbde25e999246d1ed2659f1f0 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Mon, 17 Oct 2022 15:12:27 +0200 Subject: [PATCH] Use absolute path to link lib3mf Turns out `$ORIGIN` is Linux-specific (I think?), so it won't work on other platforms. --- tools/export-validator/build.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tools/export-validator/build.rs b/tools/export-validator/build.rs index 7dc852b7d..1c5020cd3 100644 --- a/tools/export-validator/build.rs +++ b/tools/export-validator/build.rs @@ -11,13 +11,7 @@ fn main() -> anyhow::Result<()> { println!("cargo:rustc-link-lib=dylib=3mf"); // And this is necessary, so the linked library is found at runtime. - // - // The relative path used here is designed to work when the validator is - // executed within the repository using `cargo run`, which is the intended - // use case. - let executable_to_libs = - format!("../../tools/export-validator/{libs_dir_relative}"); - println!("cargo:rustc-link-arg=-Wl,-rpath,$ORIGIN/{executable_to_libs}"); + println!("cargo:rustc-link-arg=-Wl,-rpath,{libs_dir}"); Ok(()) }