Improve some feature flags

This commit is contained in:
Emil Ernerfeldt 2022-01-31 19:17:49 +01:00
parent 2183e9fdea
commit b5aaa5fa6f
6 changed files with 25 additions and 13 deletions

View file

@ -48,7 +48,7 @@ links = ["webbrowser"]
# experimental support for a screen reader # experimental support for a screen reader
screen_reader = ["tts"] screen_reader = ["tts"]
persistence = ["egui/serialize", "serde"] persistence = ["egui/serialize", "serde"] # can't add epi/persistence here because of https://github.com/rust-lang/cargo/issues/8832
serialize = ["egui/serialize", "serde"] serialize = ["egui/serialize", "serde"]
# implement bytemuck on most types. # implement bytemuck on most types.

View file

@ -58,7 +58,7 @@ default_fonts = ["egui/default_fonts"]
# enable opening links in a browser when an egui hyperlink is clicked. # enable opening links in a browser when an egui hyperlink is clicked.
links = ["egui-winit/links"] links = ["egui-winit/links"]
# enable code for sabing # enable code for saving state
persistence = [ persistence = [
"egui-winit/persistence", "egui-winit/persistence",
"egui/persistence", "egui/persistence",
@ -71,6 +71,5 @@ persistence = [
screen_reader = ["egui-winit/screen_reader"] screen_reader = ["egui-winit/screen_reader"]
# enable glutin/winit integration. # enable glutin/winit integration.
# if you want to use glow painter on web disable it. # if you want to use glow painter on web disable this feature.
# if disabled reduce crate size and build time.
winit = ["egui-winit", "glutin"] winit = ["egui-winit", "glutin"]

View file

@ -35,7 +35,7 @@ bytemuck = { version = "1.7.2", features = ["derive"], optional = true }
cint = { version = "^0.2.2", optional = true } cint = { version = "^0.2.2", optional = true }
nohash-hasher = "0.2" nohash-hasher = "0.2"
parking_lot = { version = "0.11", optional = true } # Using parking_lot over std::sync::Mutex gives 50% speedups in some real-world scenarios. parking_lot = { version = "0.11", optional = true } # Using parking_lot over std::sync::Mutex gives 50% speedups in some real-world scenarios.
serde = { version = "1", features = ["derive"], optional = true } serde = { version = "1", features = ["derive", "rc"], optional = true }
[features] [features]
default = ["default_fonts", "multi_threaded"] default = ["default_fonts", "multi_threaded"]

View file

@ -33,4 +33,4 @@ serde = { version = "1", optional = true }
[features] [features]
default = [] default = []
file_storage = ["directories-next", "ron", "serde"] file_storage = ["directories-next", "ron", "serde"]
persistence = ["ron", "serde"] persistence = ["ron", "serde", "egui/persistence"]

View file

@ -42,13 +42,14 @@ rm -f docs/${CRATE_NAME}_bg.wasm
echo "Building rust…" echo "Building rust…"
BUILD=release BUILD=release
cargo build \ (cd $CRATE_NAME &&
-p ${CRATE_NAME} \ cargo build \
--release \ --release \
--lib \ --lib \
--target wasm32-unknown-unknown \ --target wasm32-unknown-unknown \
--no-default-features \ --no-default-features \
--features ${FEATURES} --features ${FEATURES}
)
# Get the output directory (in the workspace it is in another location) # Get the output directory (in the workspace it is in another location)
TARGET=`cargo metadata --format-version=1 | jq --raw-output .target_directory` TARGET=`cargo metadata --format-version=1 | jq --raw-output .target_directory`

View file

@ -33,6 +33,18 @@ cargo doc --document-private-items --no-deps --all-features
(cd egui_glium && cargo check --no-default-features) (cd egui_glium && cargo check --no-default-features)
(cd egui_glow && cargo check --no-default-features) (cd egui_glow && cargo check --no-default-features)
(cd eframe && cargo check --all-features)
(cd egui && cargo check --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 emath && cargo check --all-features)
(cd epaint && cargo check --all-features)
(cd epi && cargo check --all-features)
# ------------------------------------------------------------ # ------------------------------------------------------------
# #