diff --git a/helix-term/build.rs b/helix-term/build.rs
index 60a64659..63276a06 100644
--- a/helix-term/build.rs
+++ b/helix-term/build.rs
@@ -17,6 +17,7 @@ mod windows_rc {
     use std::{env, io, path::Path, path::PathBuf, process};
 
     pub(crate) fn link_icon_in_windows_exe(icon_path: &str) {
+        #[cfg(target_env = "msvc")]
         let rc_exe = find_rc_exe().expect("Windows SDK is to be installed along with MSVC");
 
         let output = env::var("OUT_DIR").expect("Env var OUT_DIR should have been set by compiler");
@@ -26,12 +27,43 @@ pub(crate) fn link_icon_in_windows_exe(icon_path: &str) {
         write_resource_file(&rc_path, icon_path).unwrap();
 
         let resource_file = PathBuf::from(&output_dir).join("resource.lib");
+
+        #[cfg(target_env = "msvc")]
         compile_with_toolkit_msvc(rc_exe, resource_file, rc_path);
 
+        #[cfg(target_env = "gnu")]
+        compile_with_windres_gnu(resource_file, rc_path);
+
         println!("cargo:rustc-link-search=native={}", output_dir.display());
         println!("cargo:rustc-link-lib=dylib=resource");
     }
 
+    #[cfg(target_env = "gnu")]
+    fn compile_with_windres_gnu(output: PathBuf, input: PathBuf) {
+        let mut command = process::Command::new("windres.exe");
+        let command = command.arg(format!(
+            "--include-dir={}",
+            env::var("CARGO_MANIFEST_DIR")
+                .unwrap()
+        ));
+
+        let status = command
+            .arg(format!("--output={}", output.display()))
+            .arg(format!("{}", input.display()))
+            .output()
+            .unwrap();
+
+        println!(
+            "Windres Output:\n{}\n------",
+            String::from_utf8_lossy(&status.stdout)
+        );
+        println!(
+            "Windres Error:\n{}\n------",
+            String::from_utf8_lossy(&status.stderr)
+        );
+    }
+
+    #[cfg(target_env = "msvc")]
     fn compile_with_toolkit_msvc(rc_exe: PathBuf, output: PathBuf, input: PathBuf) {
         let mut command = process::Command::new(rc_exe);
         let command = command.arg(format!(
@@ -56,6 +88,7 @@ fn compile_with_toolkit_msvc(rc_exe: PathBuf, output: PathBuf, input: PathBuf) {
         );
     }
 
+    #[cfg(target_env = "msvc")]
     fn find_rc_exe() -> io::Result<PathBuf> {
         let find_reg_key = process::Command::new("reg")
             .arg("query")
