Skip to content

Commit

Permalink
Use more workspace dependencies (#3975)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk authored Feb 5, 2024
1 parent a5f3881 commit bcebfec
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 51 deletions.
10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,18 @@ opt-level = 2


[workspace.dependencies]
#TODO(emilk): make more things workspace dependencies
ahash = { version = "0.8.6", default-features = false, features = [
"no-rng", # we don't need DOS-protection, so we let users opt-in to it instead
"std",
] }
backtrace = "0.3"
criterion = { version = "0.5.1", default-features = false }
document-features = "0.2"
glow = "0.13"
log = { version = "0.4", features = ["std"] }
nohash-hasher = "0.2"
parking_lot = "0.12"
puffin = "0.19"
puffin_http = "0.16"
raw-window-handle = "0.6.0"
Expand Down
2 changes: 1 addition & 1 deletion crates/ecolor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ cint = { version = "0.3.1", optional = true }
color-hex = { version = "0.2.0", optional = true }

## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
document-features = { workspace = true, optional = true }

## Allow serialization using [`serde`](https://docs.rs/serde).
serde = { version = "1", optional = true, features = ["derive"] }
24 changes: 8 additions & 16 deletions crates/eframe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,7 @@ puffin = [
]

## Enables wayland support and fixes clipboard issue.
wayland = [
"egui-winit/wayland",
"egui-wgpu?/wayland",
"egui_glow?/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.
##
Expand All @@ -109,7 +105,7 @@ web_screen_reader = [
## By default, only WebGPU is enabled on web.
## If you want to enable WebGL, you need to turn on the `webgl` feature of crate `wgpu`:
##
## ```ignore
## ```toml
## wgpu = { version = "*", features = ["webgpu", "webgl"] }
## ```
##
Expand All @@ -118,11 +114,7 @@ web_screen_reader = [
wgpu = ["dep:wgpu", "dep:egui-wgpu", "dep:pollster"]

## Enables compiling for x11.
x11 = [
"egui-winit/x11",
"egui-wgpu?/x11",
"egui_glow?/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.
Expand All @@ -133,16 +125,16 @@ egui = { version = "0.25.0", path = "../egui", default-features = false, feature
"bytemuck",
"log",
] }
log = { version = "0.4", features = ["std"] }
parking_lot = "0.12"

document-features.workspace = true
log.workspace = true
parking_lot.workspace = true
raw-window-handle.workspace = true
static_assertions = "1.1.0"
thiserror.workspace = true
web-time.workspace = true

#! ### Optional dependencies
## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
# Optional dependencies

egui_glow = { version = "0.25.0", path = "../egui_glow", optional = true, default-features = false }
glow = { workspace = true, optional = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/eframe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
//! ```
//!
//! ## Feature flags
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
#![doc = document_features::document_features!()]
//!
#![warn(missing_docs)] // let's keep eframe well-documented
Expand Down
7 changes: 3 additions & 4 deletions crates/egui-wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,14 @@ epaint = { version = "0.25.0", path = "../epaint", default-features = false, fea
] }

bytemuck = "1.7"
log = { version = "0.4", features = ["std"] }
document-features.workspace = true
log.workspace = true
thiserror.workspace = true
type-map = "0.5.0"
web-time.workspace = true
wgpu = { workspace = true, features = ["wgsl"] }

#! ### Optional dependencies
## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
# Optional dependencies:

winit = { workspace = true, optional = true, default-features = false, features = [
"rwh_06",
Expand Down
2 changes: 1 addition & 1 deletion crates/egui-wgpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//! The default is to prefer WebGPU and fall back on WebGL.
//!
//! ## Feature flags
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
#![doc = document_features::document_features!()]
//!
#![allow(unsafe_code)]
Expand Down
4 changes: 2 additions & 2 deletions crates/egui-winit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ x11 = ["winit/x11", "bytemuck"]
egui = { version = "0.25.0", path = "../egui", default-features = false, features = [
"log",
] }
log = { version = "0.4", features = ["std"] }
log.workspace = true
raw-window-handle.workspace = true
web-time.workspace = true
winit = { workspace = true, default-features = false, features = ["rwh_06"] }
Expand All @@ -69,7 +69,7 @@ winit = { workspace = true, default-features = false, features = ["rwh_06"] }
accesskit_winit = { version = "0.16.0", optional = true }

## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
document-features = { workspace = true, optional = true }

puffin = { workspace = true, optional = true }
serde = { version = "1.0", optional = true, features = ["derive"] }
Expand Down
13 changes: 5 additions & 8 deletions crates/egui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,18 @@ unity = ["epaint/unity"]
[dependencies]
epaint = { version = "0.25.0", path = "../epaint", default-features = false }

ahash = { version = "0.8.6", default-features = false, features = [
"no-rng", # we don't need DOS-protection, so we let users opt-in to it instead
"std",
] }
nohash-hasher = "0.2"
ahash.workspace = true
nohash-hasher.workspace = true

#! ### Optional dependencies
accesskit = { version = "0.12", optional = true }

backtrace = { version = "0.3", optional = true }
backtrace = { workspace = true, optional = true }

## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
document-features = { workspace = true, optional = true }

log = { version = "0.4", optional = true, features = ["std"] }
log = { workspace = true, optional = true }
puffin = { workspace = true, optional = true }
ron = { version = "0.8", optional = true }
serde = { version = "1", optional = true, features = ["derive", "rc"] }
2 changes: 1 addition & 1 deletion crates/egui_demo_app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ egui_demo_lib = { version = "0.25.0", path = "../egui_demo_lib", features = [
egui_extras = { version = "0.25.0", path = "../egui_extras", features = [
"image",
] }
log = { version = "0.4", features = ["std"] }
log.workspace = true

# Optional dependencies:

Expand Down
4 changes: 2 additions & 2 deletions crates/egui_demo_lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ syntect = ["egui_extras/syntect"]
egui = { version = "0.25.0", path = "../egui", default-features = false }
egui_extras = { version = "0.25.0", path = "../egui_extras" }
egui_plot = { version = "0.25.0", path = "../egui_plot" }
log = { version = "0.4", features = ["std"] }
log.workspace = true
unicode_names2 = { version = "0.6.0", default-features = false } # this old version has fewer dependencies

#! ### Optional dependencies
chrono = { version = "0.4", optional = true, features = ["js-sys", "wasmbind"] }
## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
document-features = { workspace = true, optional = true }
serde = { version = "1", optional = true, features = ["derive"] }


Expand Down
4 changes: 2 additions & 2 deletions crates/egui_extras/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ egui = { version = "0.25.0", path = "../egui", default-features = false, feature
"serde",
] }
enum-map = { version = "2", features = ["serde"] }
log = { version = "0.4", features = ["std"] }
log.workspace = true
serde = { version = "1", features = ["derive"] }

#! ### Optional dependencies
Expand All @@ -78,7 +78,7 @@ chrono = { version = "0.4", optional = true, default-features = false, features
] }

## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
document-features = { workspace = true, optional = true }

image = { version = "0.24", optional = true, default-features = false }

Expand Down
4 changes: 2 additions & 2 deletions crates/egui_glow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ egui = { version = "0.25.0", path = "../egui", default-features = false, feature

bytemuck = "1.7"
glow.workspace = true
log = { version = "0.4", features = ["std"] }
log.workspace = true
memoffset = "0.7"
# glutin stuck on old version of raw-window-handle:
rwh_05 = { package = "raw-window-handle", version = "0.5.2", features = [
Expand All @@ -65,7 +65,7 @@ rwh_05 = { package = "raw-window-handle", version = "0.5.2", features = [

#! ### Optional dependencies
## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
document-features = { workspace = true, optional = true }

# Native:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/egui_plot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ egui = { version = "0.25.0", path = "../egui", default-features = false }

#! ### Optional dependencies
## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
document-features = { workspace = true, optional = true }

serde = { version = "1", optional = true, features = ["derive"] }
2 changes: 1 addition & 1 deletion crates/emath/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extra_asserts = []
bytemuck = { version = "1.7.2", optional = true, features = ["derive"] }

## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
document-features = { workspace = true, optional = true }

## [`mint`](https://docs.rs/mint) enables interoperability with other math libraries such as [`glam`](https://docs.rs/glam) and [`nalgebra`](https://docs.rs/nalgebra).
mint = { version = "0.5.6", optional = true }
Expand Down
15 changes: 6 additions & 9 deletions crates/epaint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,17 @@ emath = { version = "0.25.0", path = "../emath" }
ecolor = { version = "0.25.0", path = "../ecolor" }

ab_glyph = "0.2.11"
ahash = { version = "0.8.1", default-features = false, features = [
"no-rng", # we don't need DOS-protection, so we let users opt-in to it instead
"std",
] }
nohash-hasher = "0.2"
parking_lot = "0.12" # Using parking_lot over std::sync::Mutex gives 50% speedups in some real-world scenarios.
ahash.workspace = true
nohash-hasher.workspace = true
parking_lot.workspace = true # Using parking_lot over std::sync::Mutex gives 50% speedups in some real-world scenarios.

#! ### Optional dependencies
bytemuck = { version = "1.7.2", optional = true, features = ["derive"] }

## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
document-features = { workspace = true, optional = true }

log = { version = "0.4", optional = true, features = ["std"] }
log = { workspace = true, optional = true }
puffin = { workspace = true, optional = true }
rayon = { version = "1.7", optional = true }

Expand All @@ -106,7 +103,7 @@ serde = { version = "1", optional = true, features = ["derive", "rc"] }

# native:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
backtrace = { version = "0.3", optional = true }
backtrace = { workspace = true, optional = true }


[dev-dependencies]
Expand Down

0 comments on commit bcebfec

Please sign in to comment.