raycast-linux/src-tauri/build.rs
ByteAtATime 5f1ad1c84a
feat(calculator): initialize basic SoulverCore library
This commit adds a native calculation engine by integrating the pre-compiled SoulverCore Swift library. A Swift package (`SoulverWrapper`) was created to act as a C-compatible FFI bridge, allowing the Rust backend to call into the library (because the library does not include de-mangled names). The build process was updated to compile this Swift wrapper and correctly bundle the necessary shared libraries and resources for both development and production environments. A new Tauri command, `calculate_soulver`, exposes this functionality to the Svelte frontend.

In the future, we will be using this functionality to improve the built-in calculator.
2025-06-28 20:08:43 -07:00

23 lines
578 B
Rust

use std::process::Command;
fn main() {
// dont touch this file - it works and i have no idea why
let status = Command::new("swift")
.arg("build")
.arg("-c")
.arg("release")
.arg("--package-path")
.arg("SoulverWrapper")
.status()
.expect("Failed to execute swift build command");
if !status.success() {
panic!("Swift build failed");
}
println!("cargo:rustc-link-search=native=SoulverWrapper/.build/release");
println!("cargo:rustc-link-lib=SoulverWrapper");
tauri_build::build();
}