Files
jan/src-tauri/build.rs

33 lines
946 B
Rust

fn main() {
#[cfg(not(feature = "cli"))]
{
tauri_build::build();
}
#[cfg(target_os = "macos")]
{
println!("cargo:rustc-link-arg=-Wl,-rpath,/usr/lib/swift");
if let Ok(output) = std::process::Command::new("xcrun")
.args(["--toolchain", "default", "--find", "swift"])
.output()
{
let swift_path = String::from_utf8_lossy(&output.stdout)
.trim()
.to_string();
if let Some(toolchain) = std::path::Path::new(&swift_path)
.parent()
.and_then(|p| p.parent())
{
let lib_path = toolchain.join("lib/swift/macosx");
if lib_path.exists() {
println!(
"cargo:rustc-link-arg=-Wl,-rpath,{}",
lib_path.display()
);
}
}
}
}
}