-
-
Save jsantell/94e3196bf0c8cb410e3fa3eb496dea29 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -x | |
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | |
PROJECT_DIR="$SCRIPT_DIR/../" | |
pushd $PROJECT_DIR | |
rm -rf ./LibNoosphere.xcframework | |
rm -rf ./target/headers | |
mkdir -p ./target/headers | |
cp -r ./rust/noosphere/include ./target/headers/include | |
# cargo run --package noosphere --example generate_header --features headers --locked | |
cp ./noosphere.h ./target/headers/include/noosphere/noosphere.h | |
TARGETS=( | |
"aarch64-apple-ios" | |
"x86_64-apple-ios" | |
"aarch64-apple-ios-sim" | |
"x86_64-apple-darwin" | |
"aarch64-apple-darwin" | |
) | |
for TARGET in "${TARGETS[@]}"; do | |
rustup target install $TARGET | |
# cargo build --package noosphere --release --target $TARGET --locked | |
cargo build --package noosphere --target $TARGET --locked | |
done | |
mkdir -p ./target/macos | |
mkdir -p ./target/simulator | |
lipo -create \ | |
./target/x86_64-apple-darwin/release/libnoosphere.a \ | |
./target/aarch64-apple-darwin/release/libnoosphere.a \ | |
-output ./target/macos/libnoosphere.a | |
lipo -create \ | |
./target/x86_64-apple-ios/release/libnoosphere.a \ | |
./target/aarch64-apple-ios-sim/release/libnoosphere.a \ | |
-output ./target/simulator/libnoosphere.a | |
xcodebuild -create-xcframework \ | |
-library ./target/macos/libnoosphere.a \ | |
-headers ./target/headers/include/ \ | |
-library ./target/simulator/libnoosphere.a \ | |
-headers ./target/headers/include/ \ | |
-library ./target/aarch64-apple-ios/release/libnoosphere.a \ | |
-headers ./target/headers/include/ \ | |
-output ./LibNoosphere.xcframework | |
popd | |
set +x | |
set +e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment