Commit 1208720d authored by NzSN's avatar NzSN

update wasm-build.sh

parent 71c43211
...@@ -14,6 +14,7 @@ FFMPEG_ST=yes ...@@ -14,6 +14,7 @@ FFMPEG_ST=yes
EMSDK=/emsdk EMSDK=/emsdk
LIB_DIR=${WORKPATH}/lib
THIRD_DIR=${WORKPATH}/lib/third/build THIRD_DIR=${WORKPATH}/lib/third/build
FFMPEG_PROTO=${WORKPATH}/src/protos/src FFMPEG_PROTO=${WORKPATH}/src/protos/src
...@@ -22,6 +23,15 @@ WASM_DIR=${WORKPATH}/src/wasms ...@@ -22,6 +23,15 @@ WASM_DIR=${WORKPATH}/src/wasms
DEBUG="-O3" DEBUG="-O3"
#DEBUG="-O1 -g -fno-inline -gseparate-dwarf=/src/demo2/temp.debug.wasm -s SEPARATE_DWARF_URL=http://localhost:5000/temp.debug.wasm" #DEBUG="-O1 -g -fno-inline -gseparate-dwarf=/src/demo2/temp.debug.wasm -s SEPARATE_DWARF_URL=http://localhost:5000/temp.debug.wasm"
# Build Protocols
cd ${LIB_DIR}/ffmpeg.sharedmemproto
###############################################################################
# FFMPEG Core #
###############################################################################
#--closure 压缩胶水代码,有可能会造成变量重复定义。生产发布可设为1 #--closure 压缩胶水代码,有可能会造成变量重复定义。生产发布可设为1
OPTIM_FLAGS="$DEBUG --closure 0" OPTIM_FLAGS="$DEBUG --closure 0"
...@@ -39,16 +49,12 @@ else ...@@ -39,16 +49,12 @@ else
fi fi
FLAGS=( FLAGS=(
-I$WORKPATH/lib/ffmpeg-emcc/include -L$WORKPATH/lib/ffmpeg-emcc/lib -I$THIRD_DIR/include -L$THIRD_DIR/lib -I$WORKPATH/lib/ffmpeg-emcc/include -L$WORKPATH/lib/ffmpeg-emcc/lib -I$THIRD_DIR/include -L$THIRD_DIR/lib -Wno-deprecated-declarations
-Wno-deprecated-declarations -Wno-pointer-sign -Wno-implicit-int-float-conversion -Wno-switch -Wno-parentheses -Qunused-arguments -Wno-pointer-sign -Wno-implicit-int-float-conversion -Wno-switch -Wno-parentheses -Qunused-arguments -lavdevice -lavfilter -lavformat -lavcodec
-lavdevice -lavfilter -lavformat -lavcodec -lswresample -lswscale -lavutil -lpostproc -lswresample -lswscale -lavutil -lpostproc -lm -lharfbuzz -lfribidi -lass -lx264 -lx265 -lvpx -lwavpack -lmp3lame
-lm -lharfbuzz -lfribidi -lass -lx264 -lx265 -lvpx -lwavpack -lmp3lame -lfdk-aac -lvorbis -lvorbisenc -lvorbisfile -logg -ltheora -ltheoraenc -ltheoradec -lz -lfreetype -lopus -lwebp -lfdk-aac -lvorbis -lvorbisenc -lvorbisfile -logg -ltheora -ltheoraenc -ltheoradec -lz -lfreetype -lopus -lwebp
$WASM_DIR/interfaces.cc $WASM_DIR/interfaces.cc
$FFMPEG_PROTO/utils.cc
$FFMPEG_PROTO/ioctx.cc
$FFMPEG_PROTO/proto/movMemProto.cc
$FFMPEG_PROTO/proto/proto.cc
-march=x86_32 -march=x86_32
-std=c++2a -std=c++2a
...@@ -58,7 +64,7 @@ FLAGS=( ...@@ -58,7 +64,7 @@ FLAGS=(
-s INVOKE_RUN=0 # not to run the main() in the beginning -s INVOKE_RUN=0 # not to run the main() in the beginning
-s EXIT_RUNTIME=1 # exit runtime after execution -s EXIT_RUNTIME=1 # exit runtime after execution
-s MODULARIZE=1 # 延迟加载 use modularized version to be more flexible -s MODULARIZE=1 # 延迟加载 use modularized version to be more flexible
-s EXPORT_NAME="createMP4Encoder" # assign export name for browser -s EXPORT_NAME="createParaEncoder" # assign export name for browser
-s EXPORTED_FUNCTIONS="[_main,_malloc,_free]" # export main and proxy_main funcs -s EXPORTED_FUNCTIONS="[_main,_malloc,_free]" # export main and proxy_main funcs
-s EXPORTED_RUNTIME_METHODS="[FS, cwrap, ccall, setValue, writeAsciiToMemory, getValue]" # export preamble funcs -s EXPORTED_RUNTIME_METHODS="[FS, cwrap, ccall, setValue, writeAsciiToMemory, getValue]" # export preamble funcs
-s INITIAL_MEMORY=268435456 # 64 KB * 1024 * 16 * 2047 = 2146435072 bytes ~= 2 GB, 268435456 =256M, 134,217,728 =128M -s INITIAL_MEMORY=268435456 # 64 KB * 1024 * 16 * 2047 = 2146435072 bytes ~= 2 GB, 268435456 =256M, 134,217,728 =128M
......
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