|
|
|
@ -11,8 +11,15 @@ fn main() {
|
|
|
|
|
target.paths.runtime_library_paths.iter().for_each(|path| {
|
|
|
|
|
println!("cargo:rustc-link-arg=-Wl,-rpath={}", path);
|
|
|
|
|
});
|
|
|
|
|
// need to link against libswiftCore and libFoundation
|
|
|
|
|
|
|
|
|
|
// link in swiftrt.o, which initializes the swift runtime
|
|
|
|
|
let arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap();
|
|
|
|
|
println!(
|
|
|
|
|
"cargo:rustc-link-arg={}/linux/{}/swiftrt.o",
|
|
|
|
|
&target.paths.runtime_resource_path, arch
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// link against the swift stdlib and all th supporting pieces
|
|
|
|
|
println!("cargo:rustc-link-lib=dylib=BlocksRuntime");
|
|
|
|
|
println!("cargo:rustc-link-lib=dylib=dispatch");
|
|
|
|
|
println!("cargo:rustc-link-lib=dylib=FoundationNetworking");
|
|
|
|
@ -59,6 +66,7 @@ pub struct SwiftTargetInfo {
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct SwiftPaths {
|
|
|
|
|
pub runtime_library_paths: Vec<String>,
|
|
|
|
|
pub runtime_resource_path: String,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
|
|
|