如果你想要知道cfg能够作用的目标,可以在终端中运行rustc --print=cfg进行查询。当然,你可以指定平台查询:rustc --print=cfg --target=x86_64-pc-windows-msvc,该命令将对64bit的 Windows 进行查询。 聪明的同学已经发现,这非常类似于条件依赖引入,那我们是不是可以根据自定义的条件来决定是否引入某个依赖呢?具...
请运行rustc --print=cfg --target=x86_64-pc-windows-msvc。
ok cargo build --release -v Compiling dep1 v0.1.0 (C:\Users\yangf\Documents\Projects\xmake_rust_macro\dep1) Running `C:\Users\yangf\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin\rustc.exe --crate-name dep1 --edition=2021 C:\Users\yangf\Documents\Projects\xmake_rust_macro\d...
[target.x86_64-pc-windows-gnu.dependencies] winhttp = "0.4.0" [target.i686-unknown-linux-gnu.dependencies] openssl = "1.0.1" 如果您使用的是自定义目标规范,请引用完整路径和文件名: [target."x86_64/windows.json".dependencies] winhttp = "0.4.0" [target."i686/linux.json".dependencies] op...
cargo 1.61.0 (a028ae42f 2022-04-29) release: 1.61.0 commit-hash: a028ae42fc1376571de836be702e840ca8e060c2 commit-date: 2022-04-29 host: x86_64-pc-windows-msvc libgit2: 1.4.2 (sys:0.14.2 vendored) libcurl: 7.80.0-DEV (sys:0.4.51+curl-7.80.0 vendored ssl:Schannel) os: ...
name = "windows_x86_64_msvc" version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "504a2476202769977a040c6364301a3f65d0cc9e3fb08600b2bda150a0488316" [[package]] name = "yaml-rust" version = "0.4.5" source = "registry+https:...
error: 'cargo.exe' is not installed for the toolchain 'stable-x86_64-pc-windows-msvc' To install, run `rustup component add cargo --toolchain stable-x86_64-pc-windows-msvc` Then if I execute the suggested command, I have the following: component 'cargo' for target 'x86_64-pc-windows...
stable-x86_64-pc-windows-gnu stable-x86_64-pc-windows-msvc (default) nightly-x86_64-pc-windows-msvc deafult one is used when when you compile rust code with cargo <subcommand>. To change default toolchain rustup default <toolchain-name>. If you prefer to compile rust code only once wit...
"windows_x86_64_msvc 0.37.0", ] [[package]] name = "windows" version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1c4bd0a50ac6020f65184721f758dba47bb9fbc2133df715ec74a237b26794a" dependencies = [ "windows-implement", "...
在开发过程中,当我们需要将代码从一个平台(例如x86架构)移植到另一个平台(例如ARM架构)时,我们可能需要进行交叉编译。交叉编译是指在一个平台上生成在另一个平台上运行的可执行文件或库。 在进行交叉编译时,我们通常需要使用适用于目标平台的工具链,包括交叉编译器、交叉链接器等。其中,cargo链接器是Rust语言中...