xref: /DragonOS/kernel/Cargo.toml (revision 1ea2daad8121b77ed704e6d7c3a09f478147441d)
1[package]
2name = "dragonos_kernel"
3version = "0.1.10"
4edition = "2021"
5
6# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7
8
9[lib]
10crate-type = ["staticlib"]
11
12[workspace]
13members = [
14    "crates/*",
15    "src/libs/intertrait"
16]
17
18[features]
19default = ["backtrace", "kvm"]
20# 内核栈回溯
21backtrace = []
22# kvm
23kvm = []
24
25
26# 运行时依赖项
27[dependencies]
28acpi = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/acpi-rs.git", rev = "fb69243dcf" }
29asm_macros = { path = "crates/asm_macros" }
30atomic_enum = "=0.2.0"
31bit_field = "=0.10"
32bitfield-struct = "=0.5.3"
33bitflags = "=1.3.2"
34bitmap = { path = "crates/bitmap" }
35driver_base_macros = { "path" = "crates/driver_base_macros" }
36# 一个no_std的hashmap、hashset
37elf = { version = "=0.7.2", default-features = false }
38hashbrown = "=0.13.2"
39ida = { path = "src/libs/ida" }
40intertrait = { path = "src/libs/intertrait" }
41kdepends = { path = "crates/kdepends" }
42klog_types = { path = "crates/klog_types" }
43linkme = "=0.2"
44num = { version = "=0.4.0", default-features = false }
45num-derive = "=0.3"
46num-traits = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/num-traits.git", rev="1597c1c", default-features = false }
47smoltcp = { version = "=0.11.0", default-features = false, features = ["log", "alloc",  "socket-raw", "socket-udp", "socket-tcp", "socket-icmp", "socket-dhcpv4", "socket-dns", "proto-ipv4", "proto-ipv6"]}
48system_error = { path = "crates/system_error" }
49unified-init = { path = "crates/unified-init" }
50virtio-drivers = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/virtio-drivers", rev = "f91c807965" }
51fdt = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/fdt", rev = "9862813020" }
52uefi = { version = "=0.26.0", features = ["alloc"] }
53uefi-raw = "=0.5.0"
54paste = "=1.0.14"
55slabmalloc = { path = "crates/rust-slabmalloc" }
56log = "0.4.21"
57
58
59# target为x86_64时,使用下面的依赖
60[target.'cfg(target_arch = "x86_64")'.dependencies]
61mini-backtrace = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/mini-backtrace.git", rev = "e0b1d90940" }
62raw-cpuid = "11.0.1"
63x86 = "=0.52.0"
64x86_64 = "=0.14.10"
65
66# target为riscv64时,使用下面的依赖
67[target.'cfg(target_arch = "riscv64")'.dependencies]
68riscv = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/riscv.git", rev = "4241a97", features = [ "s-mode" ] }
69sbi-rt = { version = "=0.0.3", features = ["legacy"] }
70
71
72# 构建时依赖项
73[build-dependencies]
74kernel_build = { path = "../build-scripts/kernel_build" }
75
76[dependencies.lazy_static]
77version = "=1.4.0"
78# 由于在no_std环境,而lazy_static依赖了spin库,因此需要指定其使用no_std
79features = ["spin_no_std"]
80
81# The development profile, used for `cargo build`
82[profile.dev]
83# opt-level = 0  # Controls the --opt-level the compiler builds with
84debug = true   # Controls whether the compiler passes `-g`
85
86# The release profile, used for `cargo build --release`
87[profile.release]
88debug = false
89