diff --git a/crates/zed/build.rs b/crates/zed/build.rs index 690444705c9ed52cf96901a7cda81e04eabeeb4e..4b27d939aee833058d03771907b53324a6ce50d0 100644 --- a/crates/zed/build.rs +++ b/crates/zed/build.rs @@ -82,10 +82,8 @@ fn main() { } } - #[cfg(target_os = "windows")] - { - #[cfg(target_env = "msvc")] - { + if cfg!(windows) { + if cfg!(target_env = "msvc") { // todo(windows): This is to avoid stack overflow. Remove it when solved. println!("cargo:rustc-link-arg=/stack:{}", 8 * 1024 * 1024); } @@ -102,7 +100,7 @@ fn main() { let conpty_dll_target = target_dir.join("conpty.dll"); let open_console_target = target_dir.join("OpenConsole.exe"); - let conpty_url = "https://github.com/microsoft/terminal/releases/download/v1.23.13503.0/Microsoft.Windows.Console.ConPTY.1.23.251216003.nupkg"; + let conpty_url = "https://github.com/microsoft/terminal/releases/download/v1.24.10621.0/Microsoft.Windows.Console.ConPTY.1.24.260303001.nupkg"; let nupkg_path = out_dir.join("conpty.nupkg.zip"); let extract_dir = out_dir.join("conpty"); @@ -217,21 +215,24 @@ fn main() { println!("cargo:rerun-if-env-changed=RELEASE_CHANNEL"); println!("cargo:rerun-if-changed={}", icon.display()); - let mut res = winresource::WindowsResource::new(); + #[cfg(windows)] + { + let mut res = winresource::WindowsResource::new(); - // Depending on the security applied to the computer, winresource might fail - // fetching the RC path. Therefore, we add a way to explicitly specify the - // toolkit path, allowing winresource to use a valid RC path. - if let Some(explicit_rc_toolkit_path) = std::env::var("ZED_RC_TOOLKIT_PATH").ok() { - res.set_toolkit_path(explicit_rc_toolkit_path.as_str()); - } - res.set_icon(icon.to_str().unwrap()); - res.set("FileDescription", "Zed"); - res.set("ProductName", "Zed"); + // Depending on the security applied to the computer, winresource might fail + // fetching the RC path. Therefore, we add a way to explicitly specify the + // toolkit path, allowing winresource to use a valid RC path. + if let Some(explicit_rc_toolkit_path) = std::env::var("ZED_RC_TOOLKIT_PATH").ok() { + res.set_toolkit_path(explicit_rc_toolkit_path.as_str()); + } + res.set_icon(icon.to_str().unwrap()); + res.set("FileDescription", "Zed"); + res.set("ProductName", "Zed"); - if let Err(e) = res.compile() { - eprintln!("{}", e); - std::process::exit(1); + if let Err(e) = res.compile() { + eprintln!("{}", e); + std::process::exit(1); + } } } }