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

egui-winit: Remove android-activity dependency + add Activity backend features #2863

Merged
merged 1 commit into from
Apr 18, 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 @@ -199,7 +199,7 @@ jobs:
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2

- run: cargo check --features wgpu --target aarch64-linux-android
- run: cargo check --features wgpu,android-native-activity --target aarch64-linux-android
working-directory: crates/eframe

# ---------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions crates/eframe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ __screenshot = ["dep:image"]
## This overrides the `glow` feature.
wgpu = ["dep:wgpu", "dep:egui-wgpu", "dep:pollster"]

# 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 `egui-winit` on Android
android-native-activity = [ "egui-winit/android-native-activity" ]
## Enable the `game-activity` backend via `egui-winit` on Android
android-game-activity = [ "egui-winit/android-game-activity" ]

[dependencies]
egui = { version = "0.21.0", path = "../egui", default-features = false, features = [
Expand Down
13 changes: 10 additions & 3 deletions crates/egui-winit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ 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",
Expand Down Expand Up @@ -76,6 +86,3 @@ smithay-clipboard = { version = "0.6.3", optional = true }
[target.'cfg(not(target_os = "android"))'.dependencies]
arboard = { version = "3.2", optional = true, default-features = false }

[target.'cfg(target_os = "android")'.dependencies]
# TODO(emilk): this is probably not the right place for specifying native-activity, but we need to do it somewhere for the CI
android-activity = { version = "0.4", features = ["native-activity"] }