Skip to content

Commit

Permalink
examples: force Winit to use in-tree android-activity
Browse files Browse the repository at this point in the history
This fixes build errors about not specifying either of the
"native-activity" or "game-activity" features.

The issue came about because the in-tree examples want to
build against the in-tree version of android-activity located
with a relative `path = ` but these particular examples
depend on Winit which would resolve a second implementation
of android-activity, via a github url - where Cargo will treat
them as completely different crates.
  • Loading branch information
rib committed Aug 12, 2022
1 parent 190a3b9 commit 4818de6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/agdk-egui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ env_logger = "0.9"
android_logger = "0.11.0"
android-activity = { path="../../android-activity", features = [ "game-activity" ] }

# Since Winit also depends on android-activity (via a github url) we need to
# make sure we only resolve a single implementation.
[patch.'https://github.com/rib/android-activity']
android-activity = { path="../../android-activity", features = [ "game-activity" ] }

[features]
default = []
desktop = []
Expand Down
5 changes: 5 additions & 0 deletions examples/agdk-winit-wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ env_logger = "0.9"
android_logger = "0.11.0"
android-activity = { path="../../android-activity", features = [ "game-activity" ] }

# Since Winit also depends on android-activity (via a github url) we need to
# make sure we only resolve a single implementation.
[patch.'https://github.com/rib/android-activity']
android-activity = { path="../../android-activity", features = [ "game-activity" ] }

[features]
default = []
desktop = []
Expand Down
5 changes: 5 additions & 0 deletions examples/na-winit-wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ env_logger = "0.9"
android_logger = "0.11.0"
android-activity = { path="../../android-activity", features = [ "native-activity" ] }

# Since Winit also depends on android-activity (via a github url) we need to
# make sure we only resolve a single implementation.
[patch.'https://github.com/rib/android-activity']
android-activity = { path="../../android-activity", features = [ "native-activity" ] }

[features]
default = []
desktop = []
Expand Down

0 comments on commit 4818de6

Please sign in to comment.