INNER CODE UNIT · Rust
target_features
EmbarkStudios/rust-gpu · crates/rustc_codegen_spirv/src/lib.rs:200
fn target_features(&self, sess: &Session, _allow_unstable: bool) -> Vec<Symbol> {
let cmdline = sess.opts.cg.target_feature.split(',');
let cfg = sess.target.options.features.split(',');
cfg.chain(cmdline)
.filter(|l| l.starts_with('+'))
.map(|l| &l[1..])
.filter(|l| !l.is_empty())
.map(Symbol::intern)
.collect()
}
fn target_override(&self, opts: &config::Options) -> Option<Target> {
match opts.target_triple {
TargetTriple::TargetTriple(ref target) => target
.parse::<target::SpirvTarget>()
.map(|target| target.rustc_target())
.ok(),
TargetTriple::TargetJson { .. } => None,