Try main.cpp instead of c.

This commit is contained in:
Alf
2020-09-24 22:50:02 -07:00
parent 711903032c
commit 039388eaf0
3 changed files with 99 additions and 8 deletions

View File

@@ -1,8 +1,21 @@
# dist/ffmpeg-webtools.js:
# mkdir -p dist && \
# emcc -L/opt/ffmpeg/lib -I/opt/ffmpeg/include/ src/main.c \
# -s EXPORTED_FUNCTIONS='["_c_avformat_version", "_openfile", "_addOne"]' \
# -s EXTRA_EXPORTED_RUNTIME_METHODS="[FS, cwrap, ccall, getValue, setValue, writeAsciiToMemory]" \
# -s INITIAL_MEMORY=268435456 \
# -lavcodec -lavformat -lavfilter -lavdevice -lswresample -lswscale -lavutil -lm -lx264 -pthread \
# -o www/public/ffmpeg-webtools.js
dist/ffmpeg-webtools.js:
mkdir -p dist && \
emcc -L/opt/ffmpeg/lib -I/opt/ffmpeg/include/ src/main.c \
-s EXPORTED_FUNCTIONS='["_version", "_openfile"]' \
-s EXTRA_EXPORTED_RUNTIME_METHODS="[FS, cwrap, ccall, setValue, writeAsciiToMemory]" \
-s INITIAL_MEMORY=268435456 \
-lavcodec -lavformat -lavfilter -lavdevice -lswresample -lswscale -lavutil -lm -lx264 -pthread \
-o $@
emcc \
--bind \
-L/opt/ffmpeg/lib \
-I/opt/ffmpeg/include/ \
-s EXTRA_EXPORTED_RUNTIME_METHODS="[FS, cwrap, ccall, getValue, setValue, writeAsciiToMemory]" \
-s INITIAL_MEMORY=268435456 \
-pthread \
-lavcodec -lavformat -lavfilter -lavdevice -lswresample -lswscale -lavutil -lm -lx264 -pthread \
-o www/public/ffmpeg-webtools.js \
src/main.cpp