mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-04-11 17:42:02 +00:00
26 lines
733 B
Bash
Executable file
26 lines
733 B
Bash
Executable file
#! /bin/sh
|
|
|
|
echo "Setting up the rust environment..."
|
|
rustup target add aarch64-apple-ios
|
|
cargo install cbindgen
|
|
|
|
echo "Building target aarch64-apple-ios..."
|
|
cargo build --target aarch64-apple-ios --features mimalloc
|
|
|
|
echo "Generating includes..."
|
|
mkdir -p target/include/
|
|
rm -rf target/include/*
|
|
cbindgen --config cbindgen.toml -o target/include/tun2proxy.h
|
|
cat > target/include/tun2proxy.modulemap <<EOF
|
|
framework module tun2proxy {
|
|
umbrella header "tun2proxy.h"
|
|
export *
|
|
module * { export * }
|
|
}
|
|
EOF
|
|
|
|
echo "Creating XCFramework"
|
|
rm -rf ./tun2proxy.xcframework
|
|
xcodebuild -create-xcframework \
|
|
-library ./target/aarch64-apple-ios/debug/libtun2proxy.a -headers ./target/include/ \
|
|
-output ./tun2proxy.xcframework
|