Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bevyengine
GitHub Repository: bevyengine/bevy
Path: blob/main/examples/no_std/library/Cargo.toml
6595 views
1
[package]
2
name = "no_std_library"
3
version = "0.1.0"
4
edition = "2024"
5
6
# Normally we'd put all dependencies in [dependencies], but this syntax is easier to document
7
[dependencies.bevy]
8
# In your library you'd use version = "x.y.z", but since this is an example inside the Bevy
9
# repository we use a path instead.
10
path = "../../../"
11
# Since `std` is a default feature, first we disable default features
12
default-features = false
13
# We're free to enable any features our library needs.
14
# Note that certain Bevy features rely on `std`.
15
features = [
16
# "bevy_color",
17
# "bevy_state",
18
]
19
20
[features]
21
# `no_std` is relatively niche, so we choose defaults to cater for the majority of our users.
22
default = ["std"]
23
24
# Below are some features we recommend libraries expose to assist with their usage and their own testing.
25
26
# Uses the Rust standard library.
27
std = ["bevy/std"]
28
29
# Uses `libm` for floating point functions.
30
libm = ["bevy/libm"]
31
32
# Rely on `critical-section` for synchronization primitives.
33
critical-section = ["bevy/critical-section"]
34
35
# Enables access to browser APIs in a web context.
36
web = ["bevy/web"]
37
38
[lints.clippy]
39
# These lints are very helpful when working on a library with `no_std` support.
40
# They will warn you if you import from `std` when you could've imported from `core` or `alloc`
41
# instead.
42
# Since `core` and `alloc` are available on any target that has `std`, there is no downside to this.
43
std_instead_of_core = "warn"
44
std_instead_of_alloc = "warn"
45
alloc_instead_of_core = "warn"
46
47