pub enum TargetSpecVersion {
Rustc_1_85_0,
Rustc_1_76_0,
}Expand description
Enum for different versions of target specs, to allow changing the target spec for different rust versions. The version listed in the enum is always the minimum version to require said target spec, with the newest version always at the top.
Variants§
Rustc_1_85_0
Introduced in 489c3ee6fd63da3ca7cf2b15e1ee709d8e078aab in the old v2 target spec way, later ported to here.
remove os: unknown, add crt-static-respected: true
Rustc_1_76_0
rustc 1.76 has been tested to correctly parse modern target spec jsons. Some later version requires them. Some earlier version fails with them (notably our 0.9.0 release).
Implementations§
Source§impl TargetSpecVersion
impl TargetSpecVersion
Sourcepub fn target_arg(
rustc_version: Version,
target: &SpirvTarget,
target_spec_folder: &Path,
) -> Result<OsString, Error>
pub fn target_arg( rustc_version: Version, target: &SpirvTarget, target_spec_folder: &Path, ) -> Result<OsString, Error>
Format the --target arg. On newer rustc versions, will create a compatible target spec json file and return
the absolute path to it, on older rustc versions may return the target name.
Sourcepub fn from_rustc_version(rustc_version: Version) -> Option<TargetSpecVersion>
pub fn from_rustc_version(rustc_version: Version) -> Option<TargetSpecVersion>
Returns the version of the target spec required for a certain rustc version. May return None if the version
is old enough to not need target specs.
Sourcepub fn format_spec(&self, target: &SpirvTarget) -> String
pub fn format_spec(&self, target: &SpirvTarget) -> String
format the target spec json
Trait Implementations§
Source§impl Clone for TargetSpecVersion
impl Clone for TargetSpecVersion
Source§fn clone(&self) -> TargetSpecVersion
fn clone(&self) -> TargetSpecVersion
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source. Read more