Allow users to opt-out of default `winit` features (#3228)

* Do not enable winit features by default

* Enable default winit features by default

* Add x11 feature
This commit is contained in:
Emil Ernerfeldt 2023-08-10 17:09:01 +02:00 committed by GitHub
parent d568d9f5d0
commit 7e035c6dd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 5 deletions

View File

@ -61,7 +61,7 @@ jobs:
run: cargo check --locked --no-default-features --lib --all-targets -p epaint
- name: check eframe --no-default-features
run: cargo check --locked --no-default-features --lib --all-targets -p eframe
run: cargo check --locked --no-default-features --features x11 --lib --all-targets -p eframe
- name: Test doc-tests
run: cargo test --doc --all-features

View File

@ -27,7 +27,14 @@ targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"]
[features]
default = ["accesskit", "default_fonts", "glow"]
default = [
"accesskit",
"default_fonts",
"glow",
"wayland",
"winit/default",
"x11",
]
## Enable platform accessibility API implementations through [AccessKit](https://accesskit.dev/).
accesskit = ["egui/accesskit", "egui-winit/accesskit"]
@ -42,6 +49,9 @@ glow = ["dep:glow", "dep:egui_glow", "dep:glutin", "dep:glutin-winit"]
## Enables wayland support and fixes clipboard issue.
wayland = ["egui-winit/wayland"]
## Enables compiling for x11.
x11 = ["egui-winit/x11"]
## Enable saving app state to disk.
persistence = [
"directories-next",
@ -109,7 +119,7 @@ image = { version = "0.24", default-features = false, features = [
"png",
] } # Needed for app icon
raw-window-handle = { version = "0.5.0" }
winit = "0.28.1"
winit = { version = "0.28.1", default-features = false }
# optional native:
directories-next = { version = "2", optional = true }

View File

@ -50,7 +50,7 @@ wgpu = "0.16.0"
## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
winit = { version = "0.28", optional = true }
winit = { version = "0.28", default-features = false, optional = true }
# Native:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]

View File

@ -18,7 +18,7 @@ all-features = true
[features]
default = ["clipboard", "links", "wayland", "winit/default"]
default = ["clipboard", "links", "wayland", "winit/default", "x11"]
## Enable platform accessibility API implementations through [AccessKit](https://accesskit.dev/).
accesskit = ["accesskit_winit", "egui/accesskit"]
@ -42,6 +42,9 @@ serde = ["egui/serde", "dep:serde"]
## Enables Wayland support.
wayland = ["winit/wayland"]
## Enables compiling for x11.
x11 = ["winit/x11"]
# Allow crates to choose an android-activity backend via Winit
# - It's important that most applications should not have to depend on android-activity directly, and can
# rely on Winit to pull in a suitable version (unlike most Rust crates, any version conflicts won't link)