mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 13:20:05 -04:00
Instead of depending on android-activity directly, this exposes the android-native-activity and android-game-activity features from Winit. This ensures that applications can choose what android-backend they use while also relying on Winit to decide what version of android-activity to use - without increasing the risk of a version conflict by having a direct dependency. _(NB: Egui doesn't currently use the android-activity API itself)_ Since android-activity provides the `android_main()` entry point for Android applications it's not possible to link in multiple version of the android-activity crate and so it's particularly important to avoid unnecessary direct dependencies that could cause a version conflict in the future. To help avoid the need for applications to directly depend on android-activity the Winit crate re-exports the android-activity API and exposes features to configure the backend so that application crates can instead rely on Winit to pull in a compatible version of android-activity. (This way version bumps for android-activity only need to be synchronized with the Winit crate). CI now enables the `android-native-activity` feature for testing. Fixes: #2829 Fixes: #2720 Closes: #2834
89 lines
3.3 KiB
TOML
89 lines
3.3 KiB
TOML
[package]
|
|
name = "egui-winit"
|
|
version = "0.21.1"
|
|
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
|
|
description = "Bindings for using egui with winit"
|
|
edition = "2021"
|
|
rust-version = "1.65"
|
|
homepage = "https://github.com/emilk/egui/tree/master/crates/egui-winit"
|
|
license = "MIT OR Apache-2.0"
|
|
readme = "README.md"
|
|
repository = "https://github.com/emilk/egui/tree/master/crates/egui-winit"
|
|
categories = ["gui", "game-development"]
|
|
keywords = ["winit", "egui", "gui", "gamedev"]
|
|
include = ["../LICENSE-APACHE", "../LICENSE-MIT", "**/*.rs", "Cargo.toml"]
|
|
|
|
[package.metadata.docs.rs]
|
|
all-features = true
|
|
|
|
|
|
[features]
|
|
default = ["clipboard", "links", "wayland", "winit/default"]
|
|
|
|
## Enable platform accessibility API implementations through [AccessKit](https://accesskit.dev/).
|
|
accesskit = ["accesskit_winit", "egui/accesskit"]
|
|
|
|
## [`bytemuck`](https://docs.rs/bytemuck) enables you to cast [`egui::epaint::Vertex`], [`egui::Vec2`] etc to `&[u8]`.
|
|
bytemuck = ["egui/bytemuck"]
|
|
|
|
## Enable cut/copy/paste to OS clipboard.
|
|
## If disabled a clipboard will be simulated so you can still copy/paste within the egui app.
|
|
clipboard = ["arboard", "smithay-clipboard"]
|
|
|
|
## Enable opening links in a browser when an egui hyperlink is clicked.
|
|
links = ["webbrowser"]
|
|
|
|
## Enable profiling with the [`puffin`](https://docs.rs/puffin) crate.
|
|
puffin = ["dep:puffin"]
|
|
|
|
## Allow serialization of [`WindowSettings`] using [`serde`](https://docs.rs/serde).
|
|
serde = ["egui/serde", "dep:serde"]
|
|
|
|
## Enables Wayland support.
|
|
wayland = ["winit/wayland"]
|
|
|
|
# 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)
|
|
# - It's also important that we don't impose an android-activity backend by taking this choice away from applications.
|
|
|
|
## Enable the `native-activity` backend via Winit on Android
|
|
android-native-activity = [ "winit/android-native-activity" ]
|
|
## Enable the `game-activity` backend via Winit on Android
|
|
android-game-activity = [ "winit/android-game-activity" ]
|
|
|
|
[dependencies]
|
|
egui = { version = "0.21.0", path = "../egui", default-features = false, features = [
|
|
"tracing",
|
|
] }
|
|
tracing = { version = "0.1", default-features = false, features = ["std"] }
|
|
winit = { version = "0.28", default-features = false }
|
|
|
|
#! ### Optional dependencies
|
|
|
|
# feature accesskit
|
|
accesskit_winit = { version = "0.12.0", optional = true }
|
|
|
|
## Enable this when generating docs.
|
|
document-features = { version = "0.2", optional = true }
|
|
|
|
puffin = { version = "0.14", optional = true }
|
|
serde = { version = "1.0", optional = true, features = ["derive"] }
|
|
|
|
webbrowser = { version = "0.8.3", optional = true }
|
|
|
|
[target.'cfg(not(target_arch="wasm32"))'.dependencies]
|
|
instant = { version = "0.1" }
|
|
|
|
[target.'cfg(target_arch="wasm32")'.dependencies]
|
|
instant = { version = "0.1", features = [
|
|
"wasm-bindgen",
|
|
] } # We use instant so we can (maybe) compile for web
|
|
|
|
[target.'cfg(any(target_os="linux", target_os="dragonfly", target_os="freebsd", target_os="netbsd", target_os="openbsd"))'.dependencies]
|
|
smithay-clipboard = { version = "0.6.3", optional = true }
|
|
|
|
[target.'cfg(not(target_os = "android"))'.dependencies]
|
|
arboard = { version = "3.2", optional = true, default-features = false }
|
|
|