xref: /DragonOS/kernel/Cargo.toml (revision 9430523b465b19db4dd476e9fd3038bdc2aa0c8d)
1[package]
2name = "dragonos_kernel"
3version = "0.1.9"
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" }
29atomic_enum = "=0.2.0"
30bit_field = "=0.10"
31bitfield-struct = "=0.5.3"
32bitflags = "=1.3.2"
33bitmap = { path = "crates/bitmap" }
34driver_base_macros = { "path" = "crates/driver_base_macros" }
35# 一个no_std的hashmap、hashset
36elf = { version = "=0.7.2", default-features = false }
37hashbrown = "=0.13.2"
38ida = { path = "src/libs/ida" }
39intertrait = { path = "src/libs/intertrait" }
40kdepends = { path = "crates/kdepends" }
41klog_types = { path = "crates/klog_types" }
42linkme = "=0.2"
43num = { version = "=0.4.0", default-features = false }
44num-derive = "=0.3"
45num-traits = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/num-traits.git", rev="1597c1c", default-features = false }
46smoltcp = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/smoltcp.git", rev = "9027825", default-features = false, features = ["log", "alloc",  "socket-raw", "socket-udp", "socket-tcp", "socket-icmp", "socket-dhcpv4", "socket-dns", "proto-ipv4", "proto-ipv6"]}
47system_error = { path = "crates/system_error" }
48unified-init = { path = "crates/unified-init" }
49virtio-drivers = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/virtio-drivers.git", rev = "f1d1cbb" }
50fdt = "=0.1.5"
51uefi = { version = "=0.26.0", features = ["alloc"] }
52uefi-raw = "=0.5.0"
53paste = "=1.0.14"
54
55
56# target为x86_64时,使用下面的依赖
57[target.'cfg(target_arch = "x86_64")'.dependencies]
58mini-backtrace = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/mini-backtrace.git", rev = "e0b1d90940" }
59raw-cpuid = "11.0.1"
60x86 = "=0.52.0"
61x86_64 = "=0.14.10"
62
63# target为riscv64时,使用下面的依赖
64[target.'cfg(target_arch = "riscv64")'.dependencies]
65riscv = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/riscv.git", revision = "01fc40d", features = [ "s-mode" ] }
66sbi-rt = { version = "=0.0.3", features = ["legacy"] }
67
68
69# 构建时依赖项
70[build-dependencies]
71kernel_build = { path = "../build-scripts/kernel_build" }
72
73[dependencies.lazy_static]
74version = "=1.4.0"
75# 由于在no_std环境,而lazy_static依赖了spin库,因此需要指定其使用no_std
76features = ["spin_no_std"]
77
78# The development profile, used for `cargo build`
79[profile.dev]
80# opt-level = 0  # Controls the --opt-level the compiler builds with
81debug = true   # Controls whether the compiler passes `-g`
82
83# The release profile, used for `cargo build --release`
84[profile.release]
85debug = false
86