File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 18
18
env :
19
19
RUST_BACKTRACE : 1
20
20
CARGO_PROFILE_DEV_DEBUG : 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
21
- IOS_DEPLOYMENT_TARGET : ' 16.0'
22
21
23
22
concurrency :
24
23
group : ${{ github.workflow }}-${{ github.ref }}
Original file line number Diff line number Diff line change @@ -185,6 +185,31 @@ fn main() {
185
185
PathBuf :: from ( std:: env:: var_os ( "CARGO_MANIFEST_DIR" ) . unwrap ( ) ) . join ( "mobile/ios-api" ) ;
186
186
tauri_build:: mobile:: link_swift_library ( "Tauri" , & lib_path) ;
187
187
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
+ }
188
213
}
189
214
}
190
215
}
You can’t perform that action at this time.
0 commit comments