From 3b88b825842f6e0c15eb18e83b3454388e80df0b Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 3 Jan 2023 14:10:23 -0500 Subject: [PATCH] Include swiftrt.o in binary --- build.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build.rs b/build.rs index 4ca91d5..d1a9ad4 100644 --- a/build.rs +++ b/build.rs @@ -10,6 +10,12 @@ fn main() { target.paths.runtime_library_paths.iter().for_each(|path| { println!("cargo:rustc-link-arg=-Wl,-rpath={}", path); }); + + let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap(); + println!( + "cargo:rustc-link-arg={}/linux/{}/swiftrt.o", + &target.paths.runtime_resource_path, arch + ); } } @@ -23,6 +29,7 @@ pub struct SwiftTargetInfo { #[serde(rename_all = "camelCase")] pub struct SwiftPaths { pub runtime_library_paths: Vec, + pub runtime_resource_path: String, } #[derive(Debug, Deserialize)]