[package]
name = "lemonade-app"
version = "0.0.0"
description = "Lemonade Desktop App"
authors = ["AMD"]
license = "MIT"
edition = "2021"
rust-version = "1.77.2"

# The `_lib` suffix may seem redundant but it is necessary to make the lib name unique
# and wouldn't conflict with the bin name. This seems to be only an issue on Windows.
# See https://github.com/rust-lang/cargo/issues/8519
[lib]
name = "lemonade_app_lib"
crate-type = ["staticlib", "cdylib", "rlib"]

[build-dependencies]
tauri-build = { version = "2", features = [] }

[dependencies]
tauri = { version = "2", features = ["protocol-asset", "image-ico"] }
tauri-plugin-opener = "2"
tauri-plugin-clipboard-manager = "2"
tauri-plugin-single-instance = "2"
tauri-plugin-deep-link = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tokio = { version = "1", features = ["full"] }
dirs = "5"
url = "2"
log = "0.4"
env_logger = "0.11"

# webview_shim.rs hooks the platform-native webview to:
#   (a) enable getUserMedia + auto-grant the microphone permission request
#       (Linux + Windows; macOS is already handled by wry's default UI delegate)
#   (b) inject a per-frame click interceptor that routes external http(s) link
#       clicks (including inside cross-origin iframes like the marketplace) to
#       the system browser via tauri-plugin-opener
#   (c) on Linux, intercept any non-click navigation to an external URL via
#       webkit2gtk's decide-policy signal as a belt-and-suspenders fallback
#
# All version pins match wry's so the WebView types unify across Tauri's
# internal calls and ours.

[target.'cfg(target_os = "linux")'.dependencies]
webkit2gtk = { version = "2", features = ["v2_40"] }
glib = "0.18"

[target.'cfg(target_os = "windows")'.dependencies]
webview2-com = "0.38"
windows = { version = "0.61", features = ["Win32_Foundation"] }

[target.'cfg(target_vendor = "apple")'.dependencies]
objc2 = { version = "0.6.4", features = ["exception"] }
objc2-foundation = { version = "0.3", default-features = false, features = ["std", "NSString"] }
objc2-web-kit = { version = "0.3", default-features = false, features = ["std", "WKWebView", "WKUserContentController", "WKUserScript", "block2"] }
block2 = "0.6"

[profile.release]
panic = "abort"
codegen-units = 1
lto = true
incremental = false
opt-level = "s"
strip = true
