Showing how to compile c++ project into javascript library using emscripten.
- Export a function
mysqrt
- Pass float argument to/from a function
mysqrt
- Pass array argument to/from a function
mysqrtArray
- Construct/destruct a class
MyClass
and call its member function - Wrap the compiled asmjs code for easy access using
pre.js & post.js
- Build the project using
./build.sh
Enter the main directory and run ./build.sh
(works only in UNIX-like system)
- src & include directory: the C++ project
- wrap directory: a javascript wrapper which will provide more friendly access to the built library, following umd pattern
- dist directory: the built javascript library will be here
- test directory: html testing files that call the built javascript library
- build.sh: a shell script that reads C++ project and javascript wrapper, then build the javascript library