Skip to content

Commit

Permalink
fix: Build issues caused by importing swift-rs (#225)
Browse files Browse the repository at this point in the history
* fix: Build promblems cause by import swift-rs

* chore: Delete waste newline
  • Loading branch information
XMLHexagram authored Jan 5, 2025
1 parent 02b01ce commit d20cf24
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 7 additions & 4 deletions native/hub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ tracing-appender = "0.2.3"
chrono = "0.4.38"
windows = { version = "0.58.0", features = ["Services", "Services_Store" ] }
sha2 = "0.10.8"
swift-rs = "1.0.7"

[build-dependencies]
anyhow = { version = "1.0.89", features = ["backtrace"] }
Expand All @@ -47,13 +46,17 @@ vergen-git2 = { version = "1.0.1", features = [
"rustc",
"si",
] }
swift-rs = { version = "1.0.7", features = ["build"] }


# Uncomment below to target the web.
# tokio_with_wasm = { version = "0.6.0", features = ["sync", "rt"] }
# wasm-bindgen = "0.2.92"

# Android dependencies
[target.'cfg(target_os = "android")'.dependencies]
tracing-logcat = "0.1.0"
tracing-logcat = "0.1.0"

[target.'cfg(target_os = "macos")'.dependencies]
swift-rs = "1.0.7"

[target.'cfg(target_os = "macos")'.build-dependencies]
swift-rs = { version = "1.0.7", features = ["build"] }
2 changes: 2 additions & 0 deletions native/hub/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use anyhow::Result;
use std::env;
#[cfg(target_os = "macos")]
use swift_rs::SwiftLinker;
use vergen_git2::{BuildBuilder, Emitter, Git2Builder, RustcBuilder};

Expand All @@ -23,6 +24,7 @@ fn main() -> Result<()> {
let target = std::env::var("TARGET").unwrap();

if target.contains("darwin") {
#[cfg(target_os = "macos")]
SwiftLinker::new("10.13")
.with_ios("12")
.with_package("apple-bridge-library", "./apple-bridge-library/")
Expand Down

0 comments on commit d20cf24

Please sign in to comment.