2014-05-17 02:27:49 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2017-07-04 00:10:43 +00:00
|
|
|
[ -z "${CPU}" ] && CPU="arm64"
|
2015-06-17 03:47:36 +00:00
|
|
|
CWD="$(dirname "$0")"
|
2015-10-09 09:42:49 +00:00
|
|
|
[ -z "${IOSINC}" ] && IOSINC="${CWD}/ios-include"
|
2015-12-28 01:00:54 +00:00
|
|
|
CPUS=""
|
|
|
|
CPU=`echo $CPU | sed -e 's,+, ,g'`
|
2017-11-03 18:53:11 +00:00
|
|
|
EXTRA=""
|
2015-12-28 01:00:54 +00:00
|
|
|
for a in `IFS=+ echo ${CPU}` ; do
|
|
|
|
CPUS="-arch $a ${CPUS}"
|
|
|
|
done
|
2015-12-28 19:40:18 +00:00
|
|
|
[ -z "${SDK}" ] && SDK=iphoneos
|
|
|
|
APPLE_SDK=`echo ${SDK} |tr a-z A-Z`
|
2017-07-04 00:10:43 +00:00
|
|
|
CC="xcrun --sdk ${SDK} clang ${CPUS} -DAPPLE_SDK_${APPLE_SDK}=1 -I${IOSINC} ${EXTRA}"
|
2015-12-28 01:00:54 +00:00
|
|
|
echo $CC $*
|
|
|
|
${CC} $*
|
|
|
|
r=$?
|
|
|
|
if [ "$r" != 0 ]; then
|
2017-01-31 21:13:32 +00:00
|
|
|
echo ${CC} $* >&2
|
2015-12-28 01:00:54 +00:00
|
|
|
fi
|
2018-10-21 12:56:56 +00:00
|
|
|
exit $r
|