Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 12 additions & 2 deletions crates/eframe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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",
Expand Down Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion crates/egui-wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 4 additions & 1 deletion crates/egui-winit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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)
Expand Down
Loading