mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-27 12:54:42 +00:00
Target a triple explicitly when building Swift bridge
This commit is contained in:
parent
458a6a7310
commit
b76f3372a3
1 changed files with 9 additions and 3 deletions
|
@ -1,6 +1,8 @@
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use std::{env, path::PathBuf, process::Command};
|
use std::{env, path::PathBuf, process::Command};
|
||||||
|
|
||||||
|
const SWIFT_PACKAGE_NAME: &'static str = "LiveKitBridge";
|
||||||
|
|
||||||
#[derive(Debug, Deserialize)]
|
#[derive(Debug, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct SwiftTargetInfo {
|
pub struct SwiftTargetInfo {
|
||||||
|
@ -42,9 +44,15 @@ fn build_bridge(swift_target: &SwiftTarget) {
|
||||||
"cargo:rerun-if-changed={}/Package.swift",
|
"cargo:rerun-if-changed={}/Package.swift",
|
||||||
SWIFT_PACKAGE_NAME
|
SWIFT_PACKAGE_NAME
|
||||||
);
|
);
|
||||||
|
println!(
|
||||||
|
"cargo:rerun-if-changed={}/Package.resolved",
|
||||||
|
SWIFT_PACKAGE_NAME
|
||||||
|
);
|
||||||
let swift_package_root = swift_package_root();
|
let swift_package_root = swift_package_root();
|
||||||
if !Command::new("swift")
|
if !Command::new("swift")
|
||||||
.args(&["build", "-c", &env::var("PROFILE").unwrap()])
|
.arg("build")
|
||||||
|
.args(&["--configuration", &env::var("PROFILE").unwrap()])
|
||||||
|
.args(&["--triple", &swift_target.target.triple])
|
||||||
.current_dir(&swift_package_root)
|
.current_dir(&swift_package_root)
|
||||||
.status()
|
.status()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
@ -116,8 +124,6 @@ fn get_swift_target() -> SwiftTarget {
|
||||||
serde_json::from_slice(&swift_target_info_str).unwrap()
|
serde_json::from_slice(&swift_target_info_str).unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
const SWIFT_PACKAGE_NAME: &'static str = "LiveKitBridge";
|
|
||||||
|
|
||||||
fn swift_package_root() -> PathBuf {
|
fn swift_package_root() -> PathBuf {
|
||||||
env::current_dir().unwrap().join(SWIFT_PACKAGE_NAME)
|
env::current_dir().unwrap().join(SWIFT_PACKAGE_NAME)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue