Expand description
This modules contains types storing information of target platforms.
Normally, call RustcTargetData::new to construct all the target
platform once, and then query info on your demand. For example,
RustcTargetData::dep_platform_activatedto check if platform is activated.RustcTargetData::infoto get aTargetInfofor an in-depth query.TargetInfo::rustc_outputsto get a list of supported file types.
Re-exportsΒ§
use crate::compiler::CompileKind;πuse crate::compiler::CompileMode;πuse crate::compiler::CompileTarget;πuse crate::compiler::CrateTypeExt as _;πuse crate::compiler::apply_env_config;πuse crate::context::GlobalContext;πuse crate::context::StringList;πuse crate::context::TargetConfig;πuse crate::util::interning::InternedString;πuse crate::util::CargoResult;πuse crate::util::Rustc;πuse crate::workspace::features;πuse crate::workspace::Dependency;πuse crate::workspace::Package;πuse crate::workspace::Target;πuse crate::workspace::TargetKind;πuse crate::workspace::Workspace;πuse anyhow::Context as _;πuse cargo_platform::Cfg;πuse cargo_platform::CfgExpr;πuse cargo_util::ProcessBuilder;πuse cargo_util_schemas::core::CrateType;πuse serde::Deserialize;πuse serde::Deserialize;πuse cargo_util::collections::HashMap;πuse std::cell::RefCell;πuse std::collections::hash_map::Entry;πuse std::path::PathBuf;πuse std::rc::Rc;πuse std::str;πuse std::str::FromStr;π
StructsΒ§
- File
Type - Type of each file generated by a Unit.
- Rustc
Target Data - Collection of information about
rustcand the host and target. - Target
Info - Information about the platform target gleaned from querying rustc.
EnumsΒ§
- File
Flavor - Kind of each file generated by a Unit, part of
FileType. - Flags π
- Compiler flags for either rustc or rustdoc.
FunctionsΒ§
- error_
missing_ πprint_ output - Helper for creating an error message for missing output from a certain
--printrequest. - extra_
args π - Acquire extra flags to pass to the compiler from various locations.
- host_
artifact_ πuses_ only_ host_ config - Whether a host artifact must take its configuration solely from
[host]and ignore[target]. - output_
err_ πinfo - Helper for creating an error message when parsing rustc output fails.
- parse_
crate_ πtype - Takes rustc output (using specialized command line args), and calculates the file prefix and
suffix for the given crate type, or returns
Noneif the type is not supported. (e.g., for a Rust library likelibcargo.rlib, we have prefix βlibβ and suffix βrlibβ). - rustflags_
from_ πbuild - Gets compiler flags from
[build]section in the config. Seeextra_argsfor more. - rustflags_
from_ πenv - Gets compiler flags from environment variables.
See
extra_argsfor more. - rustflags_
from_ πhost - Gets compiler flags from
[host]section in the config. Seeextra_argsfor more. - rustflags_
from_ πtarget - Gets compiler flags from
[target]section in the config. Seeextra_argsfor more.