[package]
name = "egui_demo_app"
version.workspace = true
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license.workspace = true
edition.workspace = true
rust-version.workspace = true
publish = false
default-run = "egui_demo_app"

[package.metadata.cargo-shear]
ignored = ["image", "profiling", "wasm-bindgen-futures"]

[lints]
workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--generate-link-to-definition"]

[lib]
crate-type = ["cdylib", "rlib"]


[features]
default = ["wgpu", "persistence", "wayland", "x11"]

web_app = ["http", "persistence"]

accessibility_inspector = ["dep:accesskit", "dep:accesskit_consumer", "eframe/accesskit"]
easymark = [] # easymark is off by default, because it a pretty shitty markup language
http = ["ehttp", "image/jpeg", "poll-promise", "egui_extras/image"]
image_viewer = ["image/jpeg", "egui_extras/all_loaders", "rfd"]
persistence = ["eframe/persistence", "egui_extras/serde", "egui/persistence", "serde"]
puffin = ["dep:puffin", "dep:puffin_http", "profiling/profile-with-puffin"]
serde = ["dep:serde", "egui_demo_lib/serde", "egui/serde"]
syntect = ["egui_demo_lib/syntect"]

glow = ["eframe/glow"]
wgpu = ["eframe/wgpu", "bytemuck"]
wayland = ["eframe/wayland"]
x11 = ["eframe/x11"]

[dependencies]
eframe = { workspace = true, default-features = false, features = ["web_screen_reader"] }
egui = { workspace = true, features = ["callstack", "default"] }
egui_demo_lib = { workspace = true, features = ["default", "jiff"] }
egui_extras = { workspace = true, features = ["default", "image"] }
image = { workspace = true, default-features = false, features = [
  # Ensure we can display the test images
  "png",
] }
jiff = { workspace = true, features = ["std", "tz-system", "js"] }
log.workspace = true
profiling.workspace = true

# Optional dependencies:
accesskit = { workspace = true, optional = true }
accesskit_consumer = { workspace = true, optional = true }
bytemuck = { workspace = true, optional = true }
puffin = { workspace = true, optional = true }
puffin_http = { workspace = true, optional = true }


# feature "http":
ehttp = { workspace = true, optional = true }
poll-promise = { workspace = true, optional = true }

# feature "persistence":
serde = { workspace = true, optional = true }


# native:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
# Always enable eframe's `inspection` feature on native so `EGUI_INSPECTION=1 cargo run -p
# egui_demo_app` opens an inspection port for `egui_mcp` (no-op when the env var is unset).
eframe = { workspace = true, features = ["inspection"] }
env_logger = { workspace = true, features = ["auto-color", "humantime"] }
mimalloc.workspace = true
rfd = { workspace = true, optional = true }

# web:
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen.workspace = true
wasm-bindgen-futures.workspace = true
web-sys.workspace = true

[dev-dependencies]
egui_kittest = { workspace = true, features = ["eframe", "snapshot", "wgpu"] }
