mirror of
https://github.com/ByteAtATime/raycast-linux.git
synced 2025-09-04 05:00:38 +00:00

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.
23 lines
578 B
Rust
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();
|
|
}
|