Skip to content

Commit

Permalink
a script to build cimbar.js
Browse files Browse the repository at this point in the history
  • Loading branch information
sz3 committed Feb 20, 2022
1 parent bd87003 commit 4ab275a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions package-wasm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh
#docker run --mount type=bind,source="$(pwd)",target="/usr/src/app" -it emscripten/emsdk

cd /usr/src/app

apt update
apt install python -y

cd opencv4/
mkdir opencv-build-wasm && cd opencv-build-wasm
python ../platforms/js/build_js.py build_wasm --build_wasm --emscripten_dir=/emsdk/upstream/emscripten

cd /usr/src/app
mkdir build-wasm && cd build-wasm
emcmake cmake .. -DUSE_WASM=1 -DOPENCV_DIR=/usr/src/app/opencv4
make -j5 install
(cd ../web/ && tar -czvf cimbar.wasm.tar.gz cimbar_js.* index.html main.js)

cd /usr/src/app
mkdir build-asmjs && cd build-asmjs
emcmake cmake .. -DUSE_WASM=2 -DOPENCV_DIR=/usr/src/app/opencv4
make -j5 install
(cd ../web/ && zip cimbar.asmjs.zip cimbar_js.js index.html main.js)

0 comments on commit 4ab275a

Please sign in to comment.