-
Notifications
You must be signed in to change notification settings - Fork 3
/
freetype.sh
executable file
·45 lines (36 loc) · 1.36 KB
/
freetype.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash -e
FREETYPE_VERSION=2.13.3
. sdk.sh
mkdir -p output/freetype/lib/$TARGET_ABI
mkdir -p deps; cd deps
if [ ! -d freetype-src ]; then
wget https://sourceforge.net/projects/freetype/files/freetype2/$FREETYPE_VERSION/freetype-$FREETYPE_VERSION.tar.gz
tar -xzf freetype-$FREETYPE_VERSION.tar.gz
mv freetype-$FREETYPE_VERSION freetype-src
rm freetype-$FREETYPE_VERSION.tar.gz
mkdir freetype-src/build
fi
cd freetype-src/build
cmake .. -DANDROID_STL="c++_static" -DANDROID_NATIVE_API_LEVEL="$NATIVE_API_LEVEL" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=FALSE \
-DFT_DISABLE_BZIP2=TRUE \
-DFT_DISABLE_HARFBUZZ=TRUE \
-DFT_DISABLE_BROTLI=TRUE \
-DFT_REQUIRE_PNG=TRUE \
-DFT_REQUIRE_ZLIB=TRUE \
-DPNG_LIBRARY="$ANDR_ROOT/output/libpng/lib/$TARGET_ABI/libpng.a" \
-DPNG_PNG_INCLUDE_DIR="$ANDR_ROOT/output/libpng/include" \
-DANDROID_ABI="$ANDROID_ABI" \
-DANDROID_PLATFORM="$API" \
-DCMAKE_C_FLAGS_RELEASE="$CFLAGS" \
-DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK/build/cmake/android.toolchain.cmake"
cmake --build . -j
# update `include` folder
rm -rf ../../../output/freetype/include/
cp -r ../include ../../../output/freetype/include
rm -rf ../../../output/freetype/include/dlg
# update lib
rm -rf ../../../output/freetype/lib/$TARGET_ABI/libfreetype.a
cp -r libfreetype.a ../../../output/freetype/lib/$TARGET_ABI/libfreetype.a
echo "Freetype build successful"