Skip to content

Showing how to compile c++ project into javascript library using emscripten

License

Notifications You must be signed in to change notification settings

ZuchaoWang/emcc-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

emcc-example

Showing how to compile c++ project into javascript library using emscripten.

Features

  • 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

Build

Enter the main directory and run ./build.sh (works only in UNIX-like system)

Repository overview

  • 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

About

Showing how to compile c++ project into javascript library using emscripten

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published