Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
windows: Support compiling with MinGW toolchain (part 2) (#9843)
Maksim Bondarenkoveaf65ab704db
diff --git a/Cargo.lock b/Cargo.lockindex 120fade92be..db2936f2252 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -9294,6 +9294,7 @@ dependencies = ["ctrlc","dialoguer","editor",+ "embed-manifest","fuzzy","gpui","indoc",diff --git a/crates/storybook/Cargo.toml b/crates/storybook/Cargo.tomlindex 38cc3ddc98d..5beea54061c 100644--- a/crates/storybook/Cargo.toml+++ b/crates/storybook/Cargo.toml@@ -34,5 +34,8 @@ strum = { version = "0.25.0", features = ["derive"] }theme.workspace = trueui = { workspace = true, features = ["stories"] }+[target.'cfg(target_os = "windows")'.build-dependencies]+embed-manifest = "1.4.0"+[dev-dependencies]gpui = { workspace = true, features = ["test-support"] }diff --git a/crates/storybook/build.rs b/crates/storybook/build.rsindex 4a713e4c1aa..fcb9db5cb7a 100644--- a/crates/storybook/build.rs+++ b/crates/storybook/build.rs@@ -3,16 +3,16 @@ fn main() {// TODO: We shouldn't depend on WebRTC in editorprintln!("cargo:rustc-link-arg=-Wl,-rpath,@executable_path");- if std::env::var("CARGO_CFG_TARGET_ENV").ok() == Some("msvc".to_string()) {- println!("cargo:rustc-link-arg=/stack:{}", 8 * 1024 * 1024);+ #[cfg(target_os = "windows")]+ {+ #[cfg(target_env = "msvc")]+ {+ println!("cargo:rustc-link-arg=/stack:{}", 8 * 1024 * 1024);+ }let manifest = std::path::Path::new("../zed/resources/windows/manifest.xml");println!("cargo:rerun-if-changed={}", manifest.display());- println!("cargo:rustc-link-arg-bins=/MANIFEST:EMBED");-- println!(- "cargo:rustc-link-arg-bins=/MANIFESTINPUT:{}",- manifest.canonicalize().unwrap().display()- );+ embed_manifest::embed_manifest(embed_manifest::new_manifest(manifest.to_str().unwrap()))+ .unwrap();}}diff --git a/crates/zed/build.rs b/crates/zed/build.rsindex d92796e5d53..8def598fd4f 100644--- a/crates/zed/build.rs+++ b/crates/zed/build.rs@@ -46,7 +46,8 @@ fn main() {#[cfg(target_os = "windows")]{- if std::env::var("CARGO_CFG_TARGET_ENV").ok() == Some("msvc".to_string()) {+ #[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);}