chore: correctly include swift so libraries at runtime

This commit changes the build process to include Swift shared object files, allowing users to not need to include them at runtime. However, this requires the files to be present in src-tauri/SoulverWrapper/Vendor/SoulverCore-linux at build time.
This commit is contained in:
ByteAtATime 2025-07-03 14:38:00 -07:00
parent 2b383ea8e6
commit 307d862b3b
No known key found for this signature in database
2 changed files with 8 additions and 1 deletions

View file

@ -19,6 +19,13 @@ fn main() {
panic!("Swift build failed");
}
let _ = Command::new("patchelf")
.arg("--set-rpath")
.arg("$ORIGIN")
.arg("SoulverWrapper/Vendor/SoulverCore-linux/libSoulverCoreDynamic.so")
.status()
.expect("Failed to patch elf for libSoulverCoreDynamic");
println!("cargo:rustc-link-search=native=SoulverWrapper/.build/release");
println!("cargo:rustc-link-lib=SoulverWrapper");

View file

@ -60,7 +60,7 @@
],
"externalBin": ["binaries/app"],
"resources": [
"SoulverWrapper/Vendor/SoulverCore-linux/libSoulverCoreDynamic.so",
"SoulverWrapper/Vendor/SoulverCore-linux/*",
"SoulverWrapper/Vendor/SoulverCore-linux/SoulverCore_SoulverCore.resources",
"SoulverWrapper/.build/release/libSoulverWrapper.so"
]