Skip to content

Commit c8f90f5

Browse files
author
github-actions
committed
Fix(iOS): fix freetype build
It looks like latest Xcode has removed typedef Byte, causing freetype to fail compilation. Freetype also internally define it only if it's not Apple platform. A hack define is added to make it compile again.
1 parent a3d27d7 commit c8f90f5

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

buildlibs.sh

+19-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,24 @@ cd freetype-$BUILD_FREETYPE_VERSION
55

66
echo "Building Freetype"
77

8-
if [[ "$BUILD_IOS" != "1" ]]; then
8+
if [[ "$BUILD_IOS" == "1" ]]; then
9+
LDFLAGS=-"arch arm64 -isysroot $thesysroot -miphoneos-version-min=12.0"
10+
export CC=$thecc
11+
export CXX=$thecxx
12+
./configure \
13+
--host=$TARGET \
14+
--prefix=${PWD}/build_android-${TARGET_SHORT} \
15+
--enable-shared=no --enable-static=yes \
16+
--without-zlib \
17+
--with-brotli=no \
18+
--with-png=no \
19+
--with-harfbuzz=no \
20+
"CFLAGS=-arch arm64 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -Os -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=12.0 -I$thesysroot/usr/include/libxml2/ -isysroot $thesysroot -DByte=uint8_t" \
21+
AR=/usr/bin/ar \
22+
"LDFLAGS=$LDFLAGS" \
23+
|| error_code=$?
24+
namefreetype=build_android-${TARGET_SHORT}/lib/libfreetype
25+
else
926
export PATH=$TOOLCHAIN/bin:$PATH
1027
./configure \
1128
--host=$TARGET \
@@ -20,11 +37,11 @@ if [[ "$error_code" -ne 0 ]]; then
2037
cat config.log
2138
exit $error_code
2239
fi
40+
fi
2341

2442
CFLAGS=-fno-rtti CXXFLAGS=-fno-rtti make -j4
2543
make install
2644

2745
if [[ -f "${namefreetype}.a" ]]; then
2846
clang -fPIC -shared $LDFLAGS -lbz2 -Wl,-all_load ${namefreetype}.a -o ${namefreetype}.dylib
2947
fi
30-
fi

0 commit comments

Comments
 (0)