22 lines
994 B
TOML
22 lines
994 B
TOML
# musl linux 交叉编译(Windows 主机无 cc/musl-gcc,用 rust-lld self-contained link)
|
|
# df-relay 云端部署:本地交叉产 static linux binary → scp 测试机普通运行
|
|
#
|
|
# ⚠️ 默认不要跑交叉编译,产物体积大且会污染 target/ 影响日常 build/rust-analyzer 性能。
|
|
# 需要部署 df-relay 时再显式执行,并把产物隔离到独立 target dir:
|
|
#
|
|
# CARGO_TARGET_DIR=target-musl cargo build --release --target x86_64-unknown-linux-musl -p df-relay
|
|
#
|
|
# 这样 musl 产物落到 target-musl/(已 gitignore),与主 target/ 完全隔离。
|
|
[target.x86_64-unknown-linux-musl]
|
|
linker = "rust-lld"
|
|
rustflags = ["-C", "link-self-contained=y"]
|
|
|
|
# ── 主机编译加速(Windows MSVC) ────────────────────────────
|
|
# rust-lld 比 MSVC link.exe 快 3-5x,且 Rust 自带零安装
|
|
[target.x86_64-pc-windows-msvc]
|
|
linker = "rust-lld.exe"
|
|
|
|
# 并行编译单元,留部分核心给 Zed UI 和系统
|
|
[build]
|
|
jobs = 8
|