Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit e065dda

Browse files
committed
Add build script
1 parent 8335798 commit e065dda

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ $SCRIPT_ROOT/build-theora.sh
3232
$SCRIPT_ROOT/build-opus.sh
3333
# build freetype2
3434
$SCRIPT_ROOT/build-freetype2.sh
35+
# build libwebp
36+
$SCRIPT_ROOT/build-libwebp.sh
3537
# build aom (disabled as it is extremely slow)
3638
# $SCRIPT_ROOT/build-aom.sh
3739
# configure FFmpeg with Emscripten

wasm/build-scripts/build-ffmpeg.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ FLAGS=(
99
-I. -I./fftools -I$BUILD_DIR/include
1010
-Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -L$BUILD_DIR/lib
1111
-Wno-deprecated-declarations -Wno-pointer-sign -Wno-implicit-int-float-conversion -Wno-switch -Wno-parentheses -Qunused-arguments
12-
-lavdevice -lavfilter -lavformat -lavcodec -lswresample -lswscale -lavutil -lpostproc -lm -lx264 -lx265 -lvpx -lwavpack -lmp3lame -lfdk-aac -lvorbis -lvorbisenc -lvorbisfile -logg -ltheora -ltheoraenc -ltheoradec -lz -lfreetype -lopus -pthread
12+
-lavdevice -lavfilter -lavformat -lavcodec -lswresample -lswscale -lavutil -lpostproc -lm -lx264 -lx265 -lvpx -lwavpack -lmp3lame -lfdk-aac -lvorbis -lvorbisenc -lvorbisfile -logg -ltheora -ltheoraenc -ltheoradec -lz -lfreetype -lopus -lwebp -pthread
1313
fftools/ffmpeg_opt.c fftools/ffmpeg_filter.c fftools/ffmpeg_hw.c fftools/cmdutils.c fftools/ffmpeg.c
1414
-o wasm/dist/ffmpeg-core.js
1515
-s USE_SDL=2 # use SDL2

wasm/build-scripts/build-libwebp.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
source $(dirname $0)/var.sh
5+
6+
LIB_PATH=third_party/libwebp
7+
CXXFLAGS="-s USE_PTHREADS=1 $OPTIM_FLAGS"
8+
CM_FLAGS=(
9+
-DCMAKE_INSTALL_PREFIX=$BUILD_DIR
10+
-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE
11+
-DBUILD_SHARED_LIBS=OFF
12+
-DZLIB_LIBRARY=$BUILD_DIR/lib
13+
-DZLIB_INCLUDE_DIR=$BUILD_DIR/include
14+
-DWEBP_ENABLE_SIMD=ON
15+
-DWEBP_BUILD_ANIM_UTILS=OFF
16+
-DWEBP_BUILD_CWEBP=OFF
17+
-DWEBP_BUILD_DWEBP=OFF
18+
-DWEBP_BUILD_GIF2WEBP=OFF
19+
-DWEBP_BUILD_IMG2WEBP=OFF
20+
-DWEBP_BUILD_VWEBP=OFF
21+
-DWEBP_BUILD_WEBPINFO=OFF
22+
-DWEBP_BUILD_WEBPMUX=OFF
23+
-DWEBP_BUILD_EXTRAS=OFF
24+
)
25+
echo "CM_FLAGS=${CM_FLAGS[@]}"
26+
27+
cd $LIB_PATH
28+
mkdir -p build
29+
cd build
30+
emmake cmake .. -DCMAKE_C_FLAGS="$CXXFLAGS" ${CM_FLAGS[@]}
31+
emmake make clean
32+
emmake make install
33+
cd $ROOT_DIR

wasm/build-scripts/configure-ffmpeg.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ FLAGS=(
1818
--enable-libvorbis # enable libvorbis
1919
--enable-libfreetype # enable freetype
2020
--enable-libopus # enable opus
21+
--enable-libwebp # enable libwebp
2122
# --enable-libaom # enable libaom
2223
)
2324
echo "FFMPEG_CONFIG_FLAGS=${FLAGS[@]}"

0 commit comments

Comments
 (0)