Commit e065dda9 authored by Jerome Wu's avatar Jerome Wu

Add build script

parent 83357988
......@@ -32,6 +32,8 @@ $SCRIPT_ROOT/build-theora.sh
$SCRIPT_ROOT/build-opus.sh
# build freetype2
$SCRIPT_ROOT/build-freetype2.sh
# build libwebp
$SCRIPT_ROOT/build-libwebp.sh
# build aom (disabled as it is extremely slow)
# $SCRIPT_ROOT/build-aom.sh
# configure FFmpeg with Emscripten
......
......@@ -9,7 +9,7 @@ FLAGS=(
-I. -I./fftools -I$BUILD_DIR/include
-Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -L$BUILD_DIR/lib
-Wno-deprecated-declarations -Wno-pointer-sign -Wno-implicit-int-float-conversion -Wno-switch -Wno-parentheses -Qunused-arguments
-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
-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
fftools/ffmpeg_opt.c fftools/ffmpeg_filter.c fftools/ffmpeg_hw.c fftools/cmdutils.c fftools/ffmpeg.c
-o wasm/dist/ffmpeg-core.js
-s USE_SDL=2 # use SDL2
......
#!/bin/bash
set -euo pipefail
source $(dirname $0)/var.sh
LIB_PATH=third_party/libwebp
CXXFLAGS="-s USE_PTHREADS=1 $OPTIM_FLAGS"
CM_FLAGS=(
-DCMAKE_INSTALL_PREFIX=$BUILD_DIR
-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE
-DBUILD_SHARED_LIBS=OFF
-DZLIB_LIBRARY=$BUILD_DIR/lib
-DZLIB_INCLUDE_DIR=$BUILD_DIR/include
-DWEBP_ENABLE_SIMD=ON
-DWEBP_BUILD_ANIM_UTILS=OFF
-DWEBP_BUILD_CWEBP=OFF
-DWEBP_BUILD_DWEBP=OFF
-DWEBP_BUILD_GIF2WEBP=OFF
-DWEBP_BUILD_IMG2WEBP=OFF
-DWEBP_BUILD_VWEBP=OFF
-DWEBP_BUILD_WEBPINFO=OFF
-DWEBP_BUILD_WEBPMUX=OFF
-DWEBP_BUILD_EXTRAS=OFF
)
echo "CM_FLAGS=${CM_FLAGS[@]}"
cd $LIB_PATH
mkdir -p build
cd build
emmake cmake .. -DCMAKE_C_FLAGS="$CXXFLAGS" ${CM_FLAGS[@]}
emmake make clean
emmake make install
cd $ROOT_DIR
......@@ -18,6 +18,7 @@ FLAGS=(
--enable-libvorbis # enable libvorbis
--enable-libfreetype # enable freetype
--enable-libopus # enable opus
--enable-libwebp # enable libwebp
# --enable-libaom # enable libaom
)
echo "FFMPEG_CONFIG_FLAGS=${FLAGS[@]}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment