Open mrpathos opened 9 months ago
Note that this is against head of master. I just moved back to 0.22.0 for my fork and it takes significantly more modification to link without x11 getting pulled in. So this is at least getting easier! :)
I'm glad to hear it! The fastest way to get this fully resolves is probably to open some PRs ;)
@mrpathos Could you share the modifications you made?
Is your feature request related to a problem? Please describe.
I'm using egui to build for an embedded linux platform with no x11 support. Trying to get egui to link with no x11 inclusion using glow was extremely complicated, so I switched to wgpu. The remaining x11 inclusion came from the egui-winit "clipboard" feature and wasn't optional / I couldn't fix that in my own Cargo.toml.
Building for wgpu with egui-winit "clipboard" and "links" features removed successfully yields an x11-free binary.
Describe the solution you'd like
I already forked the repo to test stuff out, but submitting an issue as per the PR requirements doc. Adding a feature to eframe that itself just includes ["egui-winit/clipboard", "egui-winit/links"], and removing those features from the non-wasm dependencies section fixes this problem. It's not a perfect solution because enabling that feature on a non-native platform will probably fail to compile, but Rust's support for per-feature-per-platform dependencies is not robust and I wasn't able to figure out how to make that work.