diff --git a/Cargo.lock b/Cargo.lock index 120fade92b..db2936f225 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.toml index 38cc3ddc98..5beea54061 100644 --- a/crates/storybook/Cargo.toml +++ b/crates/storybook/Cargo.toml @@ -34,5 +34,8 @@ strum = { version = "0.25.0", features = ["derive"] } theme.workspace = true ui = { 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.rs index 4a713e4c1a..fcb9db5cb7 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 editor println!("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.rs index d92796e5d5..8def598fd4 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); }