Browse Source

Add `x11` and `wayland` features to egui-wgpu and egui_glow (#3909)

This allows them to build correctly on Linux by passing one or both of
the features alongside `winit`.

Closes #3492
Closes #2286
pull/3925/head
YgorSouza 9 months ago
committed by GitHub
parent
commit
d72f92c41d
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 12
      crates/eframe/Cargo.toml
  2. 8
      crates/egui-wgpu/Cargo.toml
  3. 2
      crates/egui_demo_app/Cargo.toml
  4. 8
      crates/egui_glow/Cargo.toml
  5. 17
      scripts/check.sh

12
crates/eframe/Cargo.toml

@ -88,7 +88,11 @@ puffin = [
]
## Enables wayland support and fixes clipboard issue.
wayland = ["egui-winit/wayland"]
wayland = [
"egui-winit/wayland",
"egui-wgpu?/wayland",
"egui_glow?/wayland",
]
## Enable screen reader support (requires `ctx.options_mut(|o| o.screen_reader = true);`) on web.
##
@ -114,7 +118,11 @@ web_screen_reader = [
wgpu = ["dep:wgpu", "dep:egui-wgpu", "dep:pollster"]
## Enables compiling for x11.
x11 = ["egui-winit/x11"]
x11 = [
"egui-winit/x11",
"egui-wgpu?/x11",
"egui_glow?/x11",
]
## If set, eframe will look for the env-var `EFRAME_SCREENSHOT_TO` and write a screenshot to that location, and then quit.
## This is used to generate images for examples.

8
crates/egui-wgpu/Cargo.toml

@ -31,9 +31,15 @@ all-features = true
## Enable profiling with the [`puffin`](https://docs.rs/puffin) crate.
puffin = ["dep:puffin"]
## Enable [`winit`](https://docs.rs/winit) integration.
## Enable [`winit`](https://docs.rs/winit) integration. On Linux, requires either `wayland` or `x11`
winit = ["dep:winit"]
## Enables Wayland support for winit.
wayland = ["winit?/wayland"]
## Enables x11 support for winit.
x11 = ["winit?/x11"]
[dependencies]
egui = { version = "0.25.0", path = "../egui", default-features = false }

2
crates/egui_demo_app/Cargo.toml

@ -30,6 +30,8 @@ syntect = ["egui_demo_lib/syntect"]
glow = ["eframe/glow"]
wgpu = ["eframe/wgpu", "bytemuck", "dep:wgpu"]
wayland = ["eframe/wayland"]
x11 = ["eframe/x11"]
[dependencies]
chrono = { version = "0.4", default-features = false, features = [

8
crates/egui_glow/Cargo.toml

@ -39,9 +39,15 @@ links = ["egui-winit?/links"]
## Enable profiling with the [`puffin`](https://docs.rs/puffin) crate.
puffin = ["dep:puffin", "egui-winit?/puffin", "egui/puffin"]
## Enable [`winit`](https://docs.rs/winit) integration.
## Enable [`winit`](https://docs.rs/winit) integration. On Linux, requires either `wayland` or `x11`
winit = ["egui-winit", "dep:winit"]
## Enables Wayland support for winit.
wayland = ["winit?/wayland"]
## Enables x11 support for winit.
x11 = ["winit?/x11"]
[dependencies]
egui = { version = "0.25.0", path = "../egui", default-features = false, features = [

17
scripts/check.sh

@ -35,10 +35,23 @@ cargo test --quiet --all-targets --all-features
cargo test --quiet --doc # slow - checks all doc-tests
cargo check --quiet -p eframe --no-default-features --features "glow"
cargo check --quiet -p eframe --no-default-features --features "wgpu"
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
cargo check --quiet -p eframe --no-default-features --features "wgpu","x11"
cargo check --quiet -p eframe --no-default-features --features "wgpu","wayland"
else
cargo check --quiet -p eframe --no-default-features --features "wgpu"
fi
cargo check --quiet -p egui --no-default-features --features "serde"
cargo check --quiet -p egui_demo_app --no-default-features --features "glow"
cargo check --quiet -p egui_demo_app --no-default-features --features "wgpu"
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
cargo check --quiet -p egui_demo_app --no-default-features --features "wgpu","x11"
cargo check --quiet -p egui_demo_app --no-default-features --features "wgpu","wayland"
else
cargo check --quiet -p egui_demo_app --no-default-features --features "wgpu"
fi
cargo check --quiet -p egui_demo_lib --no-default-features
cargo check --quiet -p egui_extras --no-default-features
cargo check --quiet -p egui_glow --no-default-features

Loading…
Cancel
Save