180 条记录
15 私有链接
15 私有链接
静默安装msvc环境:
vs_BuildTools.exe --quiet --wait --norestart --nocache --installPath C:\BuildTools --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.Windows10SDK.19041 --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --includeRecommended
能看到进度条的安装msvc环境:
vs_BuildTools.exe --passive --wait --norestart --nocache --installPath C:\BuildTools --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.Windows10SDK.19041 --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --includeRecommended
查看当前使用的 Rust 工具链
rustup show active-toolchain
查看所有安装的工具链
rustup toolchain list
要使用 MSVC 工具链,你需要先安装相应的工具链。
rustup toolchain install stable-x86_64-pc-windows-msvc
切换到 MSVC 工具链
rustup default stable-x86_64-pc-windows-msvc
rustup show active-toolchain
切换到 gnu 工具链
rustup default stable-x86_64-pc-windows-gnu
为工程添加工具链
rustup target add stable-x86_64-pc-windows-gnu
使用某个工具链build
cargo build --target=stable-x86_64-pc-windows-gnu --release
在工程中查看工具链
rustup show