--target-dir directory
Directory for all generated artifacts and intermediate files. May also be specified with the CARGO_TARGET_DIR environment variable, or the build.target-dir config value. Defaults to target in the root of the workspace.
--target-dir directory
Directory for all generated artifacts and intermediate files. May also be specified with the CARGO_TARGET_DIR environment variable, or the build.target-dir config value. Defaults to target in the root of the workspace.
评论区
写评论嗯嗯
--
👇
chirsz-ever: 编译时的二进制中间文件默认是缓存在局部目录的,在
cargo install
的时候应该是在临时目录里,所以每次都要重新编译。感谢指点 ~
--
👇
iPixelOldC: https://doc.rust-lang.org/cargo/commands/cargo-install.html
嘛,看上去,是用单独的目录,不和你自己工程共用的(像工程的中间文件都在工程的target目录下吧)
--target-dir directory Directory for all generated artifacts and intermediate files. May also be specified with the CARGO_TARGET_DIR environment variable, or the build.target-dir config value. Defaults to target in the root of the workspace.
然后你也可以改这个目录。并且我记得rust有共用缓存的方案吧,比如sscache这些,或许可以借此少重复编译?
https://doc.rust-lang.org/cargo/commands/cargo-install.html
嘛,看上去,是用单独的目录,不和你自己工程共用的(像工程的中间文件都在工程的target目录下吧)
--target-dir directory Directory for all generated artifacts and intermediate files. May also be specified with the CARGO_TARGET_DIR environment variable, or the build.target-dir config value. Defaults to target in the root of the workspace.
然后你也可以改这个目录。并且我记得rust有共用缓存的方案吧,比如sscache这些,或许可以借此少重复编译?
编译时的二进制中间文件默认是缓存在局部目录的,在
cargo install
的时候应该是在临时目录里,所以每次都要重新编译。