Skip to content
Open
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: 5 additions & 1 deletion scripts/build_apple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ set -o pipefail # Fail pipeline if any command fails
IOS_ARCHS=("aarch64-apple-ios" "x86_64-apple-ios" "aarch64-apple-ios-sim")
MACOS_ARCHS=("aarch64-apple-darwin" "x86_64-apple-darwin")

# Min deploy version
MIN_IOS_VERSION="17.0"
MIN_MACOS_VERSION="14.0"

# Variables
CRATE_NAME="clash-ffi"
LIB_NAME="clashrs"
Expand Down Expand Up @@ -61,7 +65,7 @@ mkdir -p "$HEADERS_DIR"
# Build for all targets
echo "Building library for iOS and macOS targets..."
for target in "${IOS_ARCHS[@]}" "${MACOS_ARCHS[@]}"; do
cargo +$TOOLCHAIN build --target "$target" --release
MACOSX_DEPLOYMENT_TARGET=$MIN_MACOS_VERSION IPHONEOS_DEPLOYMENT_TARGET=$MIN_IOS_VERSION cargo +$TOOLCHAIN build --target "$target" --release
mkdir -p "$OUTPUT_DIR/$target"
cp "target/$target/release/lib${LIB_NAME}.a" "$OUTPUT_DIR/$target/"
done
Expand Down
Loading