I'm trying to expose more opencv modules to the existing opencv.js 
javascript module <http://https//www.npmjs.com/package/opencv.js>.

Following the official opencv 
instructions https://docs.opencv.org/3.4.5/d4/da1/tutorial_js_setup.html, I 
was able to build a wasm version of opencv.js (see here 
<https://github.com/mjyc/opencv/tree/js3.4.5_calib3d/platforms/js/opencv.js> 
for more details), but it behaves differently than the one provided in the 
npm pkg - https//www.npmjs.com/package/opencv.js

Specifically, the opencv.js I built require me to define the 
"onRuntimeInitialized" field in the imported module (as reported by others 
<https://dev.to/kjunichi/requireopencvjs-is-not-enough-for-using-opencvjs-8ff>, 
see here <https://codesandbox.io/s/jomzo509>) where the one provided in npm 
pkg does not (see here <https://codesandbox.io/s/53y2vnznpp>, their module 
does not have "onRuntimeInitialized" and "wasmMaxTableSize", "wasmMemory", 
... that are existing in the opencv.js I built).

I believe I can build opencv like the person who built the opencv.js like 
changing some emscripten flags for, but can't figure out what those flags 
are. Here are some places where the build script provided by opencv is 
setting emscripten flags:

   - 
   
https://github.com/mjyc/opencv/blob/js3.4.5_calib3d/platforms/js/build_js.py#L151
   - 
   
https://github.com/mjyc/opencv/blob/js3.4.5_calib3d/modules/js/CMakeLists.txt#L87-L93
   

How can I can build an wasm so it does not require me to define 
"onRuntimeInitialized" but loads all required modules at the import time?

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to