* add llamacpp plugin * Refactor llamacpp plugin * add utils plugin * remove utils folder * add hardware implementation * add utils folder + move utils function * organize cargo files * refactor utils src * refactor util * apply fmt * fmt * Update gguf + reformat * add permission for gguf commands * fix cargo test windows * revert yarn lock * remove cargo.lock for hardware plugin * ignore cargo.lock file * Fix hardware invoke + refactor hardware + refactor tests, constants * use api wrapper in extension to invoke hardware call + api wrapper build integration * add newline at EOF (per Akarshan) * add vi mock for getSystemInfo
21 lines
605 B
Rust
21 lines
605 B
Rust
use tauri::{path::BaseDirectory, Manager, Runtime};
|
|
|
|
pub fn get_jan_libvulkan_path<R: Runtime>(app: tauri::AppHandle<R>) -> String {
|
|
let lib_name = if cfg!(target_os = "windows") {
|
|
"vulkan-1.dll"
|
|
} else if cfg!(target_os = "linux") {
|
|
"libvulkan.so"
|
|
} else {
|
|
return "".to_string();
|
|
};
|
|
|
|
// NOTE: this does not work in test mode (mock app)
|
|
match app.path().resolve(
|
|
format!("resources/lib/{}", lib_name),
|
|
BaseDirectory::Resource,
|
|
) {
|
|
Ok(lib_path) => lib_path.to_string_lossy().to_string(),
|
|
Err(_) => "".to_string(),
|
|
}
|
|
}
|