macOS: support newer SDKs

Update to match Xcode command-line-tools SDKs from 10.X to 16.X

Signed-off-by: Doug Junkins <douglas.junkins@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Doug Junkins 2022-11-21 12:55:47 -08:00 committed by Dirk Hohndel
parent 520be78fa8
commit d537e16cb1

View file

@ -178,14 +178,11 @@ if [ "$PLATFORM" = Darwin ] ; then
exit 1;
fi
# find a 10.x base SDK to use, or if none can be found, find a numbered 11.x base SDK to use
BASESDK=$(ls $SDKROOT | grep "MacOSX10\.1.\.sdk" | head -1 | sed -e "s/MacOSX//;s/\.sdk//")
BASESDK=$(ls $SDKROOT | grep -E "MacOSX1[0-6]\.[0-9]+\.sdk" | head -1 | sed -e "s/MacOSX//;s/\.sdk//")
if [ -z "$BASESDK" ] ; then
BASESDK=$(ls $SDKROOT | grep -E "MacOSX11\.[0-9]+\.sdk" | head -1 | sed -e "s/MacOSX//;s/\.sdk//")
if [ -z "$BASESDK" ] ; then
echo "Cannot find a base SDK of type 10.x or 11.x under the SDK root of ${SDKROOT}"
echo "Cannot find a base SDK of type 1[0-6].x under the SDK root of ${SDKROOT}"
exit 1;
fi
fi
if [ "$ARCHS" != "" ] ; then
# we do assume that the two architectures mentioned are x86_64 and arm64 .. that's kinda wrong
MAC_CMAKE="-DCMAKE_OSX_DEPLOYMENT_TARGET=${BASESDK} -DCMAKE_OSX_SYSROOT=${SDKROOT}/MacOSX${BASESDK}.sdk/ -DCMAKE_OSX_ARCHITECTURES='x86_64;arm64'"