From 9dc45796c970d5d49618405fad4f5d098a78ae08 Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Thu, 13 Aug 2015 19:17:02 -0700 Subject: [PATCH] Fix build for Xcode 7.0 beta 5. This beta has added (or at least rearranged) the SDKs to include WatchOS. This results in SDK_IOS_VERSION finding the WatchOS version number (2.0) instead of the iOS SDK version number. Fix this by rewriting the lines that handle xcodebuild to use different logic that is more robust. Tested on Xcode 6.4 and Xcode 7.0 beta 5. --- build-mac/dependencies/prepare-cyrus-sasl.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build-mac/dependencies/prepare-cyrus-sasl.sh b/build-mac/dependencies/prepare-cyrus-sasl.sh index 02af7e7..bbe12d8 100755 --- a/build-mac/dependencies/prepare-cyrus-sasl.sh +++ b/build-mac/dependencies/prepare-cyrus-sasl.sh @@ -111,14 +111,15 @@ LIB_NAME=$ARCHIVE TARGETS="iPhoneOS iPhoneSimulator" SDK_IOS_MIN_VERSION=7.0 -SDK_IOS_VERSION="`xcodebuild -version -sdk 2>/dev/null | egrep SDKVersion | tail -n 1 | sed -E -n -e 's|SDKVersion: *(.*) *$|\1|p'`" +SDK_IOS_VERSION="$(xcodebuild -version -sdk 'iphoneos' 2>/dev/null | egrep '^SDKVersion: ' | cut -d" " -f 2 | sort -n | tail -n1)" BUILD_DIR="$tmpdir/build" INSTALL_PATH="${BUILD_DIR}/${LIB_NAME}/universal" for TARGET in $TARGETS; do DEVELOPER="$(xcode-select --print-path)" - SYSROOT="`xcodebuild -version -sdk 2>/dev/null | egrep $TARGET -B 3 | egrep '^Path: '| egrep $SDK_IOS_VERSION | sort -u | tail -n 1| cut -d ' ' -f 2`" + SDK_ID="$(echo "$TARGET$SDK_IOS_VERSION" | tr A-Z a-z)" + SYSROOT="$(xcodebuild -version -sdk "$SDK_ID" 2>/dev/null | egrep '^Path: ' | cut -d ' ' -f 2)" case $TARGET in (iPhoneOS)