ios multi-arch universal lib

This commit is contained in:
Evan Feenstra
2022-07-07 18:53:03 -07:00
parent ea1abbfcd3
commit 2e083bf81d
6 changed files with 600 additions and 14 deletions

18
crypter-ffi/build-swift.sh Executable file
View File

@@ -0,0 +1,18 @@
echo "=> creating C FFI scaffolding"
uniffi-bindgen scaffolding src/crypter.udl
echo "=> creating swift bindings"
uniffi-bindgen generate src/crypter.udl --language swift
echo "=> creating swift bindings"
sed -i '' 's/module\ crypterFFI/framework\ module\ crypterFFI/' src/crypterFFI.modulemap
echo "=> building x86_64-apple-ios"
cross build --target=x86_64-apple-ios --release
echo "=> building aarch64-apple-ios"
cross build --target=aarch64-apple-ios --release
echo "=> combining into a universal lib"
lipo -create target/x86_64-apple-ios/release/libcrypter.a target/aarch64-apple-ios/release/libcrypter.a -output target/universal-crypter.a
echo "=> done!"