-
Notifications
You must be signed in to change notification settings - Fork 45
/
build_opencv.sh
42 lines (25 loc) · 1.21 KB
/
build_opencv.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
#needs python and emscripten installed and available on the command line
cd opencv_src
if [[ "${1}" == "small" ]] ; then
export IMGALIGN_OPT="-Oz"
#python ./platforms/js/build_js.py build_Oz --build_wasm --enable_exception --allow_memory_growth --binaryen_trap_mode_clamp
python ./platforms/js/build_js.py build_Oz --build_wasm --binaryen_trap_mode_clamp --allow_memory_growth --Oz
cd ..
mv ./opencv_src/build_Oz/bin/opencv.js ./public/js/opencv_3_4_custom_Oz.js
elif [[ "${1}" == "both" ]] ; then
export IMGALIGN_OPT="-O3"
python ./platforms/js/build_js.py build_O3 --build_wasm --binaryen_trap_mode_clamp --allow_memory_growth --O3
cd ..
mv ./opencv_src/build_O3/bin/opencv.js ./public/js/opencv_3_4_custom_O3.js
cd opencv_src
export IMGALIGN_OPT="-Oz"
python ./platforms/js/build_js.py build_Oz --build_wasm --binaryen_trap_mode_clamp --allow_memory_growth --Oz
cd ..
mv ./opencv_src/build_Oz/bin/opencv.js ./public/js/opencv_3_4_custom_Oz.js
else
export IMGALIGN_OPT="-O3"
python ./platforms/js/build_js.py build_O3 --build_wasm --binaryen_trap_mode_clamp --allow_memory_growth --O3
cd ..
mv ./opencv_src/build_O3/bin/opencv.js ./public/js/opencv_3_4_custom_O3.js
fi