Skip to content

Commit 08919f7

Browse files
authored
don't download verso when targetting mobile (#18)
* don't download verso when targetting mobile * return Error * Better error message Signed-off-by: Ludea <ludovicw35@hotmail.com> * Note to explain Not found error Signed-off-by: Ludea <ludovicw35@hotmail.com> * link to verso release Signed-off-by: Ludea <ludovicw35@hotmail.com> * Better error message and return error earlier Signed-off-by: Ludea <ludovicw35@hotmail.com> * mve to Known issues and add config file tips Signed-off-by: Ludea <ludovicw35@hotmail.com> * Update docs
1 parent 8b1ebae commit 08919f7

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,18 @@ We currently hard coded the `Origin` header for the custom protocol IPC to work,
8989

9090
Currently, only the app wide menus on macOS are supported, per window menus are not supported yet
9191

92+
### Mobile
93+
94+
We currently only support Linux, Windows, MacOS, so no mobile (e.g. Android / iOS) support yet
95+
96+
If your app targets both desktop and mobile and want to use this runtime only on desktop, you'll need to:
97+
98+
- Include the crates in this repo only in desktop target dependencies
99+
- Enable `wry` feature on `tauri` when targeting mobile
100+
- Use `tauri::Builder::new()` instead of `tauri_runtime_verso::builder()` on mobile
101+
- Add checks to only run `get_verso_as_external_bin` when targeting desktop
102+
- Add `externalBin` only for desktop platforms, either through [tauri conf file for each platform](https://tauri.app/reference/config/#platform-specific-configuration) or `--config` flag to target a different configuration file that contains the `externalBin` field
103+
104+
---
105+
92106
For more, checkout the [documentation](https://versotile-org.github.io/tauri-runtime-verso/tauri_runtime_verso)

‎tauri-runtime-verso-build/src/lib.rs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,15 @@ pub use versoview_build;
3333
/// Downloads and extracts the pre-built versoview executable
3434
/// to `./versoview/versoview(.exe)` relative to the directory containing your `Cargo.toml` file
3535
pub fn get_verso_as_external_bin() -> io::Result<()> {
36+
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
37+
if target_os == "android" || target_os == "ios" {
38+
return Err(io::Error::other(
39+
"Versoview doesn't support mobile platforms yet",
40+
));
41+
}
42+
3643
let target_triple = std::env::var("TARGET").unwrap();
44+
3745
let project_directory = std::env::var("CARGO_MANIFEST_DIR").unwrap();
3846
let output_directory = PathBuf::from(project_directory).join("versoview");
3947

0 commit comments

Comments
 (0)