allow users to disable the warning in a feature

This commit is contained in:
Evan Almloff 2023-12-01 22:17:51 -06:00
parent 0a3b794a1c
commit a4600294c5
2 changed files with 3 additions and 2 deletions

View file

@ -59,6 +59,7 @@ devtools = ["wry/devtools"]
tray = ["wry/tray"] tray = ["wry/tray"]
dox = ["wry/dox"] dox = ["wry/dox"]
hot-reload = ["dioxus-hot-reload"] hot-reload = ["dioxus-hot-reload"]
gnu = []
[package.metadata.docs.rs] [package.metadata.docs.rs]
default-features = false default-features = false

View file

@ -20,10 +20,10 @@ mod webview;
mod mobile_shortcut; mod mobile_shortcut;
// WARN about wry support on windows gnu targets. GNU windows targets don't work well in wry currently // WARN about wry support on windows gnu targets. GNU windows targets don't work well in wry currently
#[cfg(all(windows, target_env = "gnu"))] #[cfg(all(windows, target_env = "gnu", not(feature = "gnu")))]
mod wry_gnu_warning { mod wry_gnu_warning {
#[allow(dead_code)] #[allow(dead_code)]
#[must_use = "GNU windows targets can have issues with Wry. Using the MSVC toolchain is recommended"] #[must_use = "GNU windows targets have some limitations within Wry. Using the MSVC windows toolchain is recommended. If you would like to use continue using GNU, you can read https://github.com/wravery/webview2-rs#cross-compilation and disable this warning by adding the gnu feature to dioxus-desktop in your Cargo.toml"]
struct WryGnuWarning; struct WryGnuWarning;
const _: () = { const _: () = {
let dont_use_gnu = WryGnuWarning; let dont_use_gnu = WryGnuWarning;