xref: /DragonOS/kernel/Cargo.toml (revision 7b0ef10895108a0de5ff5ef3d2f93f40cf2e33a5)
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]
16
17[features]
18default = ["backtrace", "kvm", "fatfs", "fatfs-secure"]
19# 内核栈回溯
20backtrace = []
21# kvm
22kvm = []
23
24fatfs = []
25fatfs-secure = ["fatfs"]
26driver_ps2_mouse = []
27
28# kprobe
29kprobe_test = []
30
31# 运行时依赖项
32[dependencies]
33acpi = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/acpi-rs.git", rev = "282df2af7b" }
34asm_macros = { path = "crates/asm_macros" }
35atomic_enum = "=0.2.0"
36bit_field = "=0.10"
37bitfield-struct = "=0.5.3"
38bitflags = "=1.3.2"
39bitmap = { path = "crates/bitmap" }
40driver_base_macros = { "path" = "crates/driver_base_macros" }
41elf = { version = "=0.7.2", default-features = false }
42fdt = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/fdt", rev = "9862813020" }
43# 一个no_std的hashmap、hashset
44hashbrown = "=0.13.2"
45ida = { path = "crates/ida" }
46intertrait = { path = "crates/intertrait" }
47kcmdline_macros = { path = "crates/kcmdline_macros" }
48kdepends = { path = "crates/kdepends" }
49klog_types = { path = "crates/klog_types" }
50linkme = "=0.3.27"
51num = { version = "=0.4.0", default-features = false }
52num-derive = "=0.3"
53num-traits = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/num-traits.git", rev="1597c1c", default-features = false }
54smoltcp = { 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"]}
55system_error = { path = "crates/system_error" }
56uefi = { version = "=0.26.0", features = ["alloc"] }
57uefi-raw = "=0.5.0"
58unified-init = { path = "crates/unified-init" }
59virtio-drivers = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/virtio-drivers", rev = "f91c807965" }
60wait_queue_macros = { path = "crates/wait_queue_macros" }
61paste = "=1.0.14"
62slabmalloc = { path = "crates/rust-slabmalloc" }
63log = "0.4.21"
64kprobe = { path = "crates/kprobe" }
65xarray = "0.1.0"
66lru = "0.12.3"
67
68rbpf = { path = "crates/rbpf" }
69printf-compat = { version = "0.1.1", default-features = false }
70# target为x86_64时,使用下面的依赖
71[target.'cfg(target_arch = "x86_64")'.dependencies]
72mini-backtrace = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/mini-backtrace.git", rev = "e0b1d90940" }
73multiboot2 = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/multiboot2", rev = "05739aab40" }
74raw-cpuid = "11.0.1"
75x86 = "=0.52.0"
76x86_64 = "=0.14.10"
77
78# target为riscv64时,使用下面的依赖
79[target.'cfg(target_arch = "riscv64")'.dependencies]
80riscv = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/riscv.git", rev = "4241a97", features = [ "s-mode" ] }
81sbi-rt = { version = "=0.0.3", features = ["legacy"] }
82
83
84# 构建时依赖项
85[build-dependencies]
86kernel_build = { path = "../build-scripts/kernel_build" }
87
88[dependencies.lazy_static]
89version = "=1.4.0"
90# 由于在no_std环境,而lazy_static依赖了spin库,因此需要指定其使用no_std
91features = ["spin_no_std"]
92
93# The development profile, used for `cargo build`
94[profile.dev]
95# opt-level = 0  # Controls the --opt-level the compiler builds with
96debug = true   # Controls whether the compiler passes `-g`
97
98# The release profile, used for `cargo build --release`
99[profile.release]
100debug = false
101