Skip to content

Commit c1d2b48

Browse files
committed
ash & wgpu runner: remove build script forwarding PROFILE env var
no longer necessary since d416b65
1 parent def7735 commit c1d2b48

File tree

3 files changed

+2
-23
lines changed

3 files changed

+2
-23
lines changed

examples/runners/ash/build.rs

Lines changed: 0 additions & 8 deletions
This file was deleted.

examples/runners/wgpu/build.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ fn main() -> Result<(), Box<dyn Error>> {
88
println!("cargo:rerun-if-changed=build.rs");
99
println!("cargo:rerun-if-env-changed=CARGO_CFG_TARGET_OS");
1010
println!("cargo:rerun-if-env-changed=CARGO_CFG_TARGET_ARCH");
11-
// While OUT_DIR is set for both build.rs and compiling the crate, PROFILE is only set in
12-
// build.rs. So, export it to crate compilation as well.
13-
let profile = env::var("PROFILE").unwrap();
14-
println!("cargo:rustc-env=PROFILE={profile}");
11+
1512
if target_os != "android" && target_arch != "wasm32" {
1613
return Ok(());
1714
}
15+
let profile = env::var("PROFILE").unwrap();
1816
let mut dir = PathBuf::from(env::var_os("OUT_DIR").unwrap());
1917
// Strip `$profile/build/*/out`.
2018
let ok = dir.ends_with("out")

examples/runners/wgpu/src/lib.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -236,17 +236,6 @@ pub fn main(
236236

237237
#[cfg(not(any(target_os = "android", target_arch = "wasm32")))]
238238
{
239-
// Hack: spirv_builder builds into a custom directory if running under cargo, to not
240-
// deadlock, and the default target directory if not. However, packages like `proc-macro2`
241-
// have different configurations when being built here vs. when building
242-
// rustc_codegen_spirv normally, so we *want* to build into a separate target directory, to
243-
// not have to rebuild half the crate graph every time we run. So, pretend we're running
244-
// under cargo by setting these environment variables.
245-
unsafe {
246-
std::env::set_var("OUT_DIR", env!("OUT_DIR"));
247-
std::env::set_var("PROFILE", env!("PROFILE"));
248-
}
249-
250239
if options.shader == RustGPUShader::Compute {
251240
return compute::start(&options);
252241
}

0 commit comments

Comments
 (0)