about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-09-19 22:31:53 +1000
committerGitHub <noreply@github.com>2025-09-19 22:31:53 +1000
commit743f70b6e865e831af71f0cfd70ed9497e6abef4 (patch)
treefcf9ca04f5ec6acbaa72b437473a6a4078b5bd3c /compiler
parentaa2bb56ba648057b1e5621b3329a7cc6cdff8aab (diff)
parent7f55f5761cd44b8ad49efb976ae650602fc2d42a (diff)
downloadrust-743f70b6e865e831af71f0cfd70ed9497e6abef4.tar.gz
rust-743f70b6e865e831af71f0cfd70ed9497e6abef4.zip
Rollup merge of #146663 - erickt:win, r=wesleywiser
Allow windows resource compiler to be overridden

In rust-lang/rust#146018, it is now required to provide a resource compiler on windows when compiling rust. This allows toolchain builders to explicitly provide a path to an alternative, such as llvm-rc, instead of the one that's provided by the Windows SDK.

cc ```@lambdageek```
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_windows_rc/src/lib.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_windows_rc/src/lib.rs b/compiler/rustc_windows_rc/src/lib.rs
index caa5e5ef276..5e95557501e 100644
--- a/compiler/rustc_windows_rc/src/lib.rs
+++ b/compiler/rustc_windows_rc/src/lib.rs
@@ -35,8 +35,11 @@ pub fn compile_windows_resource_file(
     resources_dir.push("resources");
     fs::create_dir_all(&resources_dir).unwrap();
 
-    let resource_compiler =
-        find_resource_compiler(&env::var("CARGO_CFG_TARGET_ARCH").unwrap()).expect("found rc.exe");
+    let resource_compiler = if let Ok(path) = env::var("RUSTC_WINDOWS_RC") {
+        path.into()
+    } else {
+        find_resource_compiler(&env::var("CARGO_CFG_TARGET_ARCH").unwrap()).expect("found rc.exe")
+    };
 
     let rc_path = resources_dir.join(file_stem.with_extension("rc"));