Skip to content

Commit f3aca55

Browse files
committed
fix(ios): link clang_rt.ios to include isPlatformVersionAtLeast
See alexcrichton/curl-rust#283
1 parent 2ec7367 commit f3aca55

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

.github/workflows/test-core.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ on:
1818
env:
1919
RUST_BACKTRACE: 1
2020
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
21-
IOS_DEPLOYMENT_TARGET: '16.0'
2221

2322
concurrency:
2423
group: ${{ github.workflow }}-${{ github.ref }}

core/tauri/build.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,31 @@ fn main() {
185185
PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap()).join("mobile/ios-api");
186186
tauri_build::mobile::link_swift_library("Tauri", &lib_path);
187187
println!("cargo:ios_library_path={}", lib_path.display());
188+
189+
println!("cargo:rustc-link-lib=clang_rt.ios");
190+
println!("cargo:rustc-link-search={}", clang_link_search_path());
191+
192+
fn clang_link_search_path() -> String {
193+
let output = std::process::Command::new("clang")
194+
.arg("--print-search-dirs")
195+
.output()
196+
.unwrap();
197+
if !output.status.success() {
198+
panic!("Can't get search paths from clang");
199+
}
200+
201+
let stdout = String::from_utf8_lossy(&output.stdout);
202+
if !stdout.contains("libraries: ") {}
203+
204+
for line in stdout.lines() {
205+
if line.contains("libraries: =") {
206+
let path = line.split('=').skip(1).next().unwrap();
207+
return format!("{}/lib/darwin", path);
208+
}
209+
}
210+
211+
panic!("clang is missing search paths");
212+
}
188213
}
189214
}
190215
}

0 commit comments

Comments
 (0)