MCPcopy Create free account
hub / github.com/Rust-GPU/rust-gpu / rust_flags

Function rust_flags

tests/src/main.rs:332–365  ·  view source on GitHub ↗

The RUSTFLAGS passed to all SPIR-V builds. FIXME(eddyb) expose most of these from `spirv-builder`.

(codegen_backend_path: &Path)

Source from the content-addressed store, hash-verified

330/// The RUSTFLAGS passed to all SPIR-V builds.
331// FIXME(eddyb) expose most of these from `spirv-builder`.
332fn rust_flags(codegen_backend_path: &Path) -> String {
333 let target_features = [
334 "Int8",
335 "Int16",
336 "Int64",
337 "Float64",
338 // Only needed for `ui/arch/read_clock_khr.rs`.
339 "ShaderClockKHR",
340 "ext:SPV_KHR_shader_clock",
341 ];
342
343 [
344 &*format!("-Zcodegen-backend={}", codegen_backend_path.display()),
345 // Ensure the codegen backend is emitted in `.d` files to force Cargo
346 // to rebuild crates compiled with it when it changes (this used to be
347 // the default until https://github.com/rust-lang/rust/pull/93969).
348 "-Zbinary-dep-depinfo",
349 "-Csymbol-mangling-version=v0",
350 "-Zcrate-attr=feature(register_tool)",
351 "-Zcrate-attr=register_tool(rust_gpu)",
352 // HACK(eddyb) this is the same configuration that we test with, and
353 // ensures no unwanted surprises from e.g. `core` debug assertions.
354 "-Coverflow-checks=off",
355 "-Cdebug-assertions=off",
356 // HACK(eddyb) we need this for `core::fmt::rt::Argument::new_*` calls
357 // to *never* be inlined, so we can pattern-match the calls themselves.
358 "-Zinline-mir=off",
359 // NOTE(eddyb) flags copied from `spirv-builder` are all above this line.
360 "-Cdebuginfo=2",
361 "-Cembed-bitcode=no",
362 &format!("-Ctarget-feature=+{}", target_features.join(",+")),
363 ]
364 .join(" ")
365}
366
367/// Convience function to map process failure to results in Rust.
368fn map_status_to_result(status: std::process::ExitStatus) -> Result<()> {

Callers 2

test_rustc_flagsMethod · 0.85
build_depsFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_rustc_flagsMethod · 0.68