Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

linux: disable mac-os specific build commands

Dzmitry Malyshaub13b5726c56d
diff --git a/crates/zed/build.rs b/crates/zed/build.rs
index 0b13f5bd2f5..6905d492e1e 100644
--- a/crates/zed/build.rs
+++ b/crates/zed/build.rs
@@ -1,25 +1,27 @@
use std::process::Command;
fn main() {
- println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=10.15.7");
-
- println!("cargo:rerun-if-env-changed=ZED_BUNDLE");
- if std::env::var("ZED_BUNDLE").ok().as_deref() == Some("true") {
- // Find WebRTC.framework in the Frameworks folder when running as part of an application bundle.
- println!("cargo:rustc-link-arg=-Wl,-rpath,@executable_path/../Frameworks");
- } else {
- // Find WebRTC.framework as a sibling of the executable when running outside of an application bundle.
- println!("cargo:rustc-link-arg=-Wl,-rpath,@executable_path");
- }
+ if cfg!(target_os = "macos") {
+ println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=10.15.7");
+
+ println!("cargo:rerun-if-env-changed=ZED_BUNDLE");
+ if std::env::var("ZED_BUNDLE").ok().as_deref() == Some("true") {
+ // Find WebRTC.framework in the Frameworks folder when running as part of an application bundle.
+ println!("cargo:rustc-link-arg=-Wl,-rpath,@executable_path/../Frameworks");
+ } else {
+ // Find WebRTC.framework as a sibling of the executable when running outside of an application bundle.
+ println!("cargo:rustc-link-arg=-Wl,-rpath,@executable_path");
+ }
- // Weakly link ReplayKit to ensure Zed can be used on macOS 10.15+.
- println!("cargo:rustc-link-arg=-Wl,-weak_framework,ReplayKit");
+ // Weakly link ReplayKit to ensure Zed can be used on macOS 10.15+.
+ println!("cargo:rustc-link-arg=-Wl,-weak_framework,ReplayKit");
- // Seems to be required to enable Swift concurrency
- println!("cargo:rustc-link-arg=-Wl,-rpath,/usr/lib/swift");
+ // Seems to be required to enable Swift concurrency
+ println!("cargo:rustc-link-arg=-Wl,-rpath,/usr/lib/swift");
- // Register exported Objective-C selectors, protocols, etc
- println!("cargo:rustc-link-arg=-Wl,-ObjC");
+ // Register exported Objective-C selectors, protocols, etc
+ println!("cargo:rustc-link-arg=-Wl,-ObjC");
+ }
// Populate git sha environment variable if git is available
println!("cargo:rerun-if-changed=../../.git/logs/HEAD");