Struct rustc_build_sysroot::SysrootBuilder
source · pub struct SysrootBuilder { /* private fields */ }
Expand description
Information about a to-be-created sysroot.
Implementations§
source§impl SysrootBuilder
impl SysrootBuilder
sourcepub fn new(sysroot_dir: &Path, target: impl Into<OsString>) -> Self
pub fn new(sysroot_dir: &Path, target: impl Into<OsString>) -> Self
Prepare to create a new sysroot in the given folder (that folder should later be passed to
rustc via --sysroot
), for the given target.
sourcepub fn build_mode(self, build_mode: BuildMode) -> Self
pub fn build_mode(self, build_mode: BuildMode) -> Self
Sets the build mode (regular build vs check-only build).
sourcepub fn sysroot_config(self, sysroot_config: SysrootConfig) -> Self
pub fn sysroot_config(self, sysroot_config: SysrootConfig) -> Self
Sets the sysroot configuration (which parts of the sysroot to build and with which features).
sourcepub fn rustflags(
self,
rustflags: impl IntoIterator<Item = impl Into<OsString>>
) -> Self
pub fn rustflags(
self,
rustflags: impl IntoIterator<Item = impl Into<OsString>>
) -> Self
Appends the given flags.
sourcepub fn rustc_version(self, rustc_version: VersionMeta) -> Self
pub fn rustc_version(self, rustc_version: VersionMeta) -> Self
Sets the rustc version information (in case the user has that available).
sourcepub fn build_from_source(self, src_dir: &Path) -> Result<()>
pub fn build_from_source(self, src_dir: &Path) -> Result<()>
Build the self
sysroot from the given sources.
src_dir
must be the library
source folder, i.e., the one that contains std/Cargo.toml
.