#!/bin/bash

set -x

FCC_ROOT=$(cd ../../..; pwd)
LIB_OUT_DIR=../../lib/OSX

ARCHS="x86_64 arm64 arm64e"

archLibs=""
for arch in $ARCHS
do
archLibs+="$LIB_OUT_DIR/$arch/libcurl.a "
./build-curl-for-arch.sh $FCC_ROOT $arch $1
done

# Not required as long as we build only for one arch
xcrun -sdk macosx lipo $archLibs -create -output "$LIB_OUT_DIR/libcurl.a"

# cp "$LIB_OUT_DIR/x86_64/libcurl.a" "$LIB_OUT_DIR/libcurl.a"
