Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add node compile #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions MY_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Node 编译流程

```sh
# 添加编译环境
source "/data/github.com/emsdk/emsdk_env.sh"

# 编译 ffavc
./build_ffmpeg.sh

# 编译 emcc
cd web/script
./build.sh

# web/script/build.sh
# web:-s ENVIRONMENT="web"
# node:-s ENVIRONMENT="node"
```
5 changes: 5 additions & 0 deletions build_ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ elif [[ $(uname) == 'Linux' ]]; then
make_dir $OUT_DIR/linux
cp -r $SOURCE_DIR/out/linux/lib/*.a $OUT_DIR/linux

# build web
../../scripts/build_ffmpeg_web.sh
make_dir $OUT_DIR/web/wasm
cp -r $SOURCE_DIR/out/web/wasm/lib/*.a $OUT_DIR/web/wasm

elif [[ $(uname) == *MINGW64* ]]; then
# build win64
win_build x64
Expand Down
2 changes: 1 addition & 1 deletion web/script/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ emcc $RELEASE_CONF -std=c++17 \
-s ERROR_ON_UNDEFINED_SYMBOLS=0 \
-s MODULARIZE=1 \
-s NO_EXIT_RUNTIME=1 \
-s ENVIRONMENT="web" \
-s ENVIRONMENT="node" \
-s EXPORT_ES6=1 \
-s USE_ES6_IMPORT_META=0 \
-o ../src/wasm/ffavc.js
Expand Down