Skip to content

Commit 4f26dcf

Browse files
fix(deps): os webview not gated in wry feature (#12833)
1 parent 4bffc32 commit 4f26dcf

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

.changes/os-webview-wry-feature.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
tauri: 'patch:bug'
3+
---
4+
5+
Fix OS webviews (`webview2` and `webkit2gtk`) are always compiled with tauri even without `wry` feature

crates/tauri/Cargo.toml

+8-4
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ tray-icon = { version = "0.20", default-features = false, features = [
9595
# linux
9696
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies]
9797
gtk = { version = "0.18", features = ["v3_24"] }
98-
webkit2gtk = { version = "=2.0.1", features = ["v2_40"] }
98+
webkit2gtk = { version = "=2.0.1", features = ["v2_40"], optional = true }
9999

100100
# macOS
101101
[target.'cfg(target_os = "macos")'.dependencies]
@@ -120,9 +120,13 @@ window-vibrancy = "0.6"
120120

121121
# windows
122122
[target."cfg(windows)".dependencies]
123-
webview2-com = "0.36"
123+
webview2-com = { version = "0.36", optional = true }
124124
window-vibrancy = "0.6"
125-
windows = { version = "0.60", features = ["Win32_Foundation"] }
125+
windows = { version = "0.60", features = [
126+
"Win32_Foundation",
127+
"Win32_UI",
128+
"Win32_UI_WindowsAndMessaging",
129+
] }
126130

127131
# mobile
128132
[target.'cfg(any(target_os = "android", all(target_vendor = "apple", not(target_os = "macos"))))'.dependencies]
@@ -180,7 +184,7 @@ tray-icon = ["dep:tray-icon"]
180184
tracing = ["dep:tracing", "tauri-macros/tracing", "tauri-runtime-wry/tracing"]
181185
test = []
182186
compression = ["tauri-macros/compression", "tauri-utils/compression"]
183-
wry = ["tauri-runtime-wry"]
187+
wry = ["webview2-com", "webkit2gtk", "tauri-runtime-wry"]
184188
# TODO: Remove in v3 - wry does not have this feature anymore
185189
objc-exception = []
186190
linux-libxdo = ["tray-icon/libxdo", "muda/libxdo"]

0 commit comments

Comments
 (0)