配置文件

Cargo 的配置文件位于两个地方:

  • ~/.cargo/config.toml

  • ${project_dir}/.cargo/config.toml

配置文件格式如下:

[build]
rustc-wrapper = "sccache"
rustflags = [
    "-C", "link-arg=-fuse-ld=mold",
    "-Clink-arg=-Wl,--no-rosegment"
]

添加链接库

[build]
rustflags = ["-C", "link-args=some.rlib"]
Last moify: 2023-09-13 05:47:56
Build time:2025-07-18 09:41:42
Powered By asphinx