Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,9 @@ std = {features = ["jemalloc"]}
[dependencies]
std = {}
```

# XCFrameworks

fat binaries cannot contain multiple slices for the same architectures. That means using simulator x86_64 and macabi x86_64 in one fat binary doesn't work.
Therefore, we can use a `xcframwork`. This PR adds `xcframework` support, however, there is an error that I don't understand yet.

17 changes: 14 additions & 3 deletions make_fat.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#!/bin/bash

# lipo together the different architectures into a universal 'fat' file
xargo build --target x86_64-apple-ios-macabi --release
xargo build --target aarch64-apple-ios --release
lipo -create -output target/libtest1.a target/{aarch64-apple-ios,x86_64-apple-ios-macabi}/release/libtest1.a
#xargo build --target x86_64-apple-ios-macabi --release
#xargo build --target aarch64-apple-ios --release
#xargo build --target x86_64-apple-ios --release

set -x

xcodebuild -create-xcframework \
-library target/aarch64-apple-ios/release/libtest1.a -headers test1_rust.h \
-library target/x86_64-apple-ios-macabi/release/libtest1.a -headers test1_rust.h \
-library target/x86_64-apple-ios/release/libtest1.a -headers test1_rust.h \
-output test1.xcframework

set +x