-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathlibpng.sh
More file actions
executable file
Β·40 lines (32 loc) Β· 1.05 KB
/
libpng.sh
File metadata and controls
executable file
Β·40 lines (32 loc) Β· 1.05 KB
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
#!/bin/bash -e
. ./sdk.sh
PNG_VERSION=1.6.58
mkdir -p output/libpng/lib/$TARGET_ABI
mkdir -p deps; cd deps
if [ ! -d libpng-src ]; then
wget -nc -O libpng-$PNG_VERSION.tar.gz https://github.com/pnggroup/libpng/archive/refs/tags/v$PNG_VERSION.tar.gz || true
tar -xaf libpng-$PNG_VERSION.tar.gz
mv libpng-$PNG_VERSION libpng-src
fi
mkdir -p libpng-src/build
cd libpng-src/build
cmake .. \
-DANDROID_NATIVE_API_LEVEL="$NATIVE_API_LEVEL" \
-DANDROID_ABI="$ANDROID_ABI" \
-DANDROID_PLATFORM="$API" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS_RELEASE="$CFLAGS" \
-DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK/build/cmake/android.toolchain.cmake" \
-DPNG_SHARED=OFF \
-DPNG_TESTS=OFF \
-DPNG_TOOLS=OFF
cmake --build . -j
# update headers
rm -rf ../../../output/libpng/include
mkdir -p ../../../output/libpng/include
cp -v ../*.h ../../../output/libpng/include
cp -v pnglibconf.h ../../../output/libpng/include
# update lib
rm -rf ../../../output/libpng/lib/$TARGET_ABI/libpng.a
cp libpng16.a ../../../output/libpng/lib/$TARGET_ABI/libpng.a
echo "libpng build successful"