Refactor and simplify feature flags
This commit is contained in:
parent
426b933d2f
commit
917f9e1768
6 changed files with 26 additions and 20 deletions
|
@ -22,6 +22,9 @@ all-features = true
|
|||
[features]
|
||||
default = ["default_fonts"]
|
||||
|
||||
# detect dark mode system preference
|
||||
dark-light = ["egui-winit/dark-light"]
|
||||
|
||||
# If set, egui will use `include_bytes!` to bundle some fonts.
|
||||
# If you plan on specifying your own fonts you may disable this feature.
|
||||
default_fonts = ["egui/default_fonts"]
|
||||
|
@ -31,7 +34,6 @@ persistence = [
|
|||
"egui-winit/persistence",
|
||||
"egui_glow/persistence",
|
||||
"egui/persistence",
|
||||
"epi/file_storage",
|
||||
"epi/persistence",
|
||||
]
|
||||
|
||||
|
@ -42,8 +44,6 @@ screen_reader = [
|
|||
"egui_web/screen_reader",
|
||||
]
|
||||
|
||||
dark-light = ["egui-winit/dark-light"] # detect dark mode system preference
|
||||
|
||||
|
||||
[dependencies]
|
||||
egui = { version = "0.17.0", path = "../egui", default-features = false }
|
||||
|
|
|
@ -20,12 +20,15 @@ all-features = true
|
|||
[features]
|
||||
default = ["clipboard", "dark-light", "links"]
|
||||
|
||||
# implement bytemuck on most types.
|
||||
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"]
|
||||
|
||||
# implement bytemuck on most types.
|
||||
bytemuck = ["egui/bytemuck"]
|
||||
# detect dark mode system preference
|
||||
dark-light = ["dep:dark-light"]
|
||||
|
||||
# Only for `egui_glow` - the official eframe/epi backend.
|
||||
epi_backend = ["epi", "glow"]
|
||||
|
@ -52,7 +55,7 @@ winit = "0.26.1"
|
|||
epi = { version = "0.17.0", path = "../epi", optional = true }
|
||||
|
||||
arboard = { version = "2.1", optional = true, default-features = false }
|
||||
dark-light = { version = "0.2.1", optional = true } # detect dark mode system preference
|
||||
dark-light = { version = "0.2.1", optional = true }
|
||||
glow = { version = "0.11", optional = true }
|
||||
serde = { version = "1.0", optional = true, features = ["derive"] }
|
||||
webbrowser = { version = "0.6", optional = true }
|
||||
|
|
|
@ -28,32 +28,32 @@ default = ["default_fonts"]
|
|||
|
||||
# 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 = ["egui-winit/clipboard"]
|
||||
clipboard = ["egui-winit?/clipboard"]
|
||||
|
||||
# detect dark mode system preference
|
||||
dark-light = ["egui-winit?/dark-light"]
|
||||
|
||||
# If set, egui will use `include_bytes!` to bundle some fonts.
|
||||
# If you plan on specifying your own fonts you may disable this feature.
|
||||
default_fonts = ["egui/default_fonts"]
|
||||
|
||||
# enable opening links in a browser when an egui hyperlink is clicked.
|
||||
links = ["egui-winit/links"]
|
||||
links = ["egui-winit?/links"]
|
||||
|
||||
# enable persisting native window options and egui memory
|
||||
persistence = [
|
||||
"egui-winit/persistence",
|
||||
"egui-winit?/persistence",
|
||||
"egui/persistence",
|
||||
"epi?/file_storage",
|
||||
"epi?/persistence",
|
||||
]
|
||||
|
||||
# experimental support for a screen reader
|
||||
screen_reader = ["egui-winit/screen_reader"]
|
||||
screen_reader = ["egui-winit?/screen_reader"]
|
||||
|
||||
# enable glutin/winit integration.
|
||||
# if you want to use glow painter on web disable this feature.
|
||||
winit = ["egui-winit", "glutin"]
|
||||
|
||||
dark-light = ["egui-winit/dark-light"] # detect dark mode system preference
|
||||
|
||||
|
||||
[dependencies]
|
||||
egui = { version = "0.17.0", path = "../egui", default-features = false, features = [
|
||||
|
|
|
@ -21,10 +21,9 @@ all-features = true
|
|||
|
||||
[features]
|
||||
default = []
|
||||
# Enable the file_storage module for storing data to disk.
|
||||
file_storage = ["directories-next", "ron", "serde"]
|
||||
|
||||
# Persist native window options and egui memory
|
||||
persistence = ["ron", "serde", "egui/persistence"]
|
||||
persistence = ["directories-next", "ron", "serde", "egui/persistence"]
|
||||
|
||||
|
||||
[dependencies]
|
||||
|
@ -33,6 +32,9 @@ glow = "0.11"
|
|||
tracing = "0.1"
|
||||
|
||||
# Optional:
|
||||
directories-next = { version = "2", optional = true }
|
||||
ron = { version = "0.7", optional = true }
|
||||
serde = { version = "1", optional = true }
|
||||
|
||||
# native:
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||
directories-next = { version = "2", optional = true }
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
#![warn(missing_docs)] // Let's keep `epi` well-documented.
|
||||
|
||||
/// File storage which can be used by native backends.
|
||||
#[cfg(feature = "file_storage")]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(feature = "persistence")]
|
||||
pub mod file_storage;
|
||||
|
||||
pub use egui; // Re-export for user convenience
|
||||
|
|
|
@ -24,7 +24,7 @@ cargo doc --document-private-items --no-deps --all-features
|
|||
(cd emath && cargo check --no-default-features)
|
||||
(cd epaint && cargo check --no-default-features)
|
||||
(cd epaint && cargo check --no-default-features --release)
|
||||
(cd egui && cargo check --no-default-features --features "serialize")
|
||||
(cd egui && cargo check --no-default-features --features "serde")
|
||||
(cd eframe && cargo check --no-default-features)
|
||||
(cd epi && cargo check --no-default-features)
|
||||
(cd egui_demo_lib && cargo check --no-default-features)
|
||||
|
@ -42,7 +42,7 @@ cargo doc --document-private-items --no-deps --all-features
|
|||
(cd egui_glium && cargo check --all-features)
|
||||
(cd egui_glow && cargo check --all-features)
|
||||
(cd egui_web && cargo check --all-features)
|
||||
# (cd egui-winit && cargo check --all-features) can't do, beacause of https://github.com/rust-lang/cargo/issues/8832
|
||||
(cd egui-winit && cargo check --all-features)
|
||||
(cd emath && cargo check --all-features)
|
||||
(cd epaint && cargo check --all-features)
|
||||
(cd epi && cargo check --all-features)
|
||||
|
|
Loading…
Reference in a new issue