• Home
  • Raw
  • Download

Lines Matching +full:xcode +full:- +full:version

13 set -e
20 # Extract Xcode version.
21 readonly XCODE=$(xcodebuild -version | grep Xcode | cut -d " " -f2)
22 if [[ -z "${XCODE}" ]] || [[ "${XCODE%%.*}" -lt 11 ]]; then
23 echo "Xcode 11.0 or higher is required!"
27 # Extract the latest SDK version from the final field of the form: iphoneosX.Y
30 xcodebuild -showsdks \
31 | grep iphoneos | sort | tail -n 1 | awk '{print substr($NF, 9)}'
32 xcodebuild -showsdks \
33 | grep macosx | sort | tail -n 1 | awk '{print substr($NF, 7)}'
43 # Names should be of the form '<platform>-[<variant>-]<architecture>'.
44 PLATFORMS[$IOS]="iPhoneOS-armv7 iPhoneOS-armv7s iPhoneOS-arm64"
45 PLATFORMS[$IOS_SIMULATOR]="iPhoneSimulator-i386 iPhoneSimulator-x86_64"
46 PLATFORMS[$MACOS]="MacOSX-x86_64"
47 PLATFORMS[$MACOS_CATALYST]="MacOSX-Catalyst-x86_64"
48 if [[ "${XCODE%%.*}" -ge 12 ]]; then
49 PLATFORMS[$MACOS]+=" MacOSX-arm64"
50 PLATFORMS[$MACOS_CATALYST]+=" MacOSX-Catalyst-arm64"
51 PLATFORMS[$IOS_SIMULATOR]+=" iPhoneSimulator-arm64"
52 elif [[ "${XCODE%%.*}" -eq 11 ]]; then
54 WARNING: Xcode 12.0 or higher is required to build targets for
55 WARNING: Apple Silicon (arm64). The XCFrameworks generated with Xcode 11 will
61 echo "Xcode 11.0 or higher is required!"
73 readonly DEVELOPER=$(xcode-select --print-path)
76 readonly LIPO=$(xcrun -sdk iphoneos${SDK[$IOS]} -find lipo)
78 if [[ -z "${SDK[$IOS]}" ]] || [[ ${SDK[$IOS]%%.*} -lt 8 ]]; then
79 echo "iOS SDK version 8.0 or higher is required!"
86 # Places framework headers in a subdirectory to avoid Xcode errors when using
89 # '.../Build/Products/Debug-iphoneos/include/types.h'
91 # $1 - path to framework
96 for d in $(find "$1" -path "*/Headers"); do
98 if [[ -d "$subdir" ]]; then
102 mv "$(echo ${subdir} | tr 'A-Z' 'a-z')" "$subdir"
110 echo "Xcode Version: ${XCODE}"
111 echo "iOS SDK Version: ${SDK[$IOS]}"
112 echo "MacOS SDK Version: ${SDK[$MACOS]}"
114 if [[ -e "${BUILDDIR}" || -e "${TARGETDIR}" || -e "${DECTARGETDIR}" \
115 || -e "${MUXTARGETDIR}" || -e "${DEMUXTARGETDIR}" \
116 || -e "${SHARPYUVTARGETDIR}" ]]; then
129 rm -rf ${BUILDDIR} ${TARGETDIR} ${DECTARGETDIR} \
132 if [[ ! -e ${SRCDIR}/configure ]]; then
154 mkdir -p "${ROOTDIR}"
156 ARCH="${PLATFORM##*-}"
170 SDKROOT="${PLATFORMSROOT}/${PLATFORM%%-*}.platform/"
171 SDKROOT+="Developer/SDKs/${PLATFORM%%-*}${sdk}.sdk/"
172 CFLAGS="-pipe -isysroot ${SDKROOT} -O3 -DNDEBUG"
175 CFLAGS+=" -fembed-bitcode"
176 CFLAGS+=" -target ${ARCH}-apple-ios${IOS_MIN_VERSION}"
177 [[ "${PLATFORM}" == *Simulator* ]] && CFLAGS+="-simulator"
179 MacOSX-Catalyst*)
180 CFLAGS+=" -target"
181 CFLAGS+=" ${ARCH}-apple-ios${MACOSX_CATALYST_MIN_VERSION}-macabi"
184 CFLAGS+=" -mmacosx-version-min=${MACOSX_MIN_VERSION}"
188 set -x
190 ${SRCDIR}/configure --host=${ARCH/arm64/aarch64}-apple-darwin \
191 --build=$(${SRCDIR}/config.guess) \
192 --prefix=${ROOTDIR} \
193 --disable-shared --enable-static \
194 --enable-libwebpdecoder --enable-swap-16bit-csp \
195 --enable-libwebpmux \
196 CC="clang -arch ${ARCH}" \
201 make V=0 -C sharpyuv install
202 make V=0 -C src install
209 # xcodebuild requires a directory for the -headers option, these will match
211 make -C src install-data DESTDIR="${ROOTDIR}/lib-headers"
212 make -C src install-commonHEADERS DESTDIR="${ROOTDIR}/dec-headers"
213 make -C src/demux install-data DESTDIR="${ROOTDIR}/demux-headers"
214 make -C src/mux install-data DESTDIR="${ROOTDIR}/mux-headers"
215 make -C sharpyuv install-data DESTDIR="${ROOTDIR}/sharpyuv-headers"
216 LIB_HEADERS="${ROOTDIR}/lib-headers/${ROOTDIR}/include/webp"
217 DEC_HEADERS="${ROOTDIR}/dec-headers/${ROOTDIR}/include/webp"
218 DEMUX_HEADERS="${ROOTDIR}/demux-headers/${ROOTDIR}/include/webp"
219 MUX_HEADERS="${ROOTDIR}/mux-headers/${ROOTDIR}/include/webp"
220 SHARPYUV_HEADERS="${ROOTDIR}/sharpyuv-headers/${ROOTDIR}/include/webp"
227 [[ -z "${LIBLIST[@]}" ]] && continue
229 # Create a temporary target directory for each <platform>[-<variant>].
232 target_dir="${target_dir%-*}"
239 mkdir -p "${target_dir}"
240 ${LIPO} -create ${LIBLIST[@]} -output "${target_lib}"
241 ${LIPO} -create ${DECLIBLIST[@]} -output "${target_declib}"
242 ${LIPO} -create ${DEMUXLIBLIST[@]} -output "${target_demuxlib}"
243 ${LIPO} -create ${MUXLIBLIST[@]} -output "${target_muxlib}"
244 ${LIPO} -create ${SHARPYUVLIBLIST[@]} -output "${target_sharpyuvlib}"
245 FAT_LIBLIST+=(-library "${target_lib}" -headers "${LIB_HEADERS}")
246 FAT_DECLIBLIST+=(-library "${target_declib}" -headers "${DEC_HEADERS}")
247 FAT_DEMUXLIBLIST+=(-library "${target_demuxlib}" -headers "${DEMUX_HEADERS}")
248 FAT_MUXLIBLIST+=(-library "${target_muxlib}" -headers "${MUX_HEADERS}")
249 FAT_SHARPYUVLIBLIST+=(-library "${target_sharpyuvlib}")
250 FAT_SHARPYUVLIBLIST+=(-headers "${SHARPYUV_HEADERS}")
255 # -create-xcframework requires universal archives to avoid e.g.:
256 # Both ios-x86_64-maccatalyst and ios-arm64-maccatalyst represent two
258 set -x
259 xcodebuild -create-xcframework "${FAT_LIBLIST[@]}" \
260 -output ${TARGETDIR}
261 xcodebuild -create-xcframework "${FAT_DECLIBLIST[@]}" \
262 -output ${DECTARGETDIR}
263 xcodebuild -create-xcframework "${FAT_DEMUXLIBLIST[@]}" \
264 -output ${DEMUXTARGETDIR}
265 xcodebuild -create-xcframework "${FAT_MUXLIBLIST[@]}" \
266 -output ${MUXTARGETDIR}
267 xcodebuild -create-xcframework "${FAT_SHARPYUVLIBLIST[@]}" \
268 -output ${SHARPYUVTARGETDIR}