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

Commit 0deba71

Browse files
committed
Update build-js.sh to create separated wasm file package
1 parent 092ad14 commit 0deba71

File tree

6 files changed

+569
-229
lines changed

6 files changed

+569
-229
lines changed

build-js.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ build_ffmpegjs() {
6060
-I. -I./fftools -I$BUILD_DIR/include \
6161
-Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -Llibpostproc -L${BUILD_DIR}/lib \
6262
-Qunused-arguments -Oz \
63-
-o dist/ffmpeg-core.js fftools/ffmpeg_opt.c fftools/ffmpeg_filter.c fftools/ffmpeg_hw.c fftools/cmdutils.c fftools/ffmpeg.c \
63+
-o $2 fftools/ffmpeg_opt.c fftools/ffmpeg_filter.c fftools/ffmpeg_hw.c fftools/cmdutils.c fftools/ffmpeg.c \
6464
-lavdevice -lavfilter -lavformat -lavcodec -lswresample -lswscale -lavutil -lpostproc -lm -lx264 -lz \
6565
--closure 1 \
6666
--pre-js javascript/prepend.js \
6767
--post-js javascript/post.js \
6868
-s USE_SDL=2 \
6969
-s MODULARIZE=1 \
70-
-s SINGLE_FILE=1 \
70+
-s SINGLE_FILE=$1 \
7171
-s EXPORTED_FUNCTIONS="[_ffmpeg]" \
7272
-s EXTRA_EXPORTED_RUNTIME_METHODS="[cwrap, FS, getValue, setValue]" \
7373
-s TOTAL_MEMORY=33554432 \
@@ -79,7 +79,8 @@ main() {
7979
build_x264
8080
configure_ffmpeg
8181
make_ffmpeg
82-
build_ffmpegjs
82+
build_ffmpegjs 1 dist/ffmpeg-core.js
83+
build_ffmpegjs 0 dist-wasm/ffmpeg-core.js
8384
}
8485

8586
main "$@"

0 commit comments

Comments
 (0)