tun2proxy/build-aarch64-apple-ios.sh

27 lines
745 B
Bash
Raw Normal View History

2024-03-24 17:20:51 +08:00
#! /bin/sh
echo "Setting up the rust environment..."
rustup target add aarch64-apple-ios
cargo install cbindgen
echo "Building target aarch64-apple-ios..."
2024-08-03 18:21:02 +08:00
cargo build --release --target aarch64-apple-ios --features mimalloc
2024-03-24 17:20:51 +08:00
echo "Generating includes..."
mkdir -p target/include/
rm -rf target/include/*
2024-11-16 23:52:17 +08:00
cbindgen --config cbindgen.toml -o target/include/tun2proxy.h
2024-03-30 12:30:01 +08:00
cat > target/include/tun2proxy.modulemap <<EOF
2024-03-24 17:20:51 +08:00
framework module tun2proxy {
umbrella header "tun2proxy.h"
export *
module * { export * }
}
EOF
echo "Creating XCFramework"
rm -rf ./tun2proxy.xcframework
xcodebuild -create-xcframework \
2024-03-30 12:30:01 +08:00
-library ./target/aarch64-apple-ios/release/libtun2proxy.a -headers ./target/include/ \
2024-03-24 17:20:51 +08:00
-output ./tun2proxy.xcframework