Skip to content

User Manual AS2WASM

erikdebruin edited this page Nov 17, 2017 · 26 revisions

Prepare

Set up your system

Your system will need to have the following tools available/installed:

make and CMake

The build of wat2wasm requires make and CMake to be installed on your computer:

make: https://www.google.com/search?q=install+make

Cmake: https://cmake.org/download/

  • PATH

    Add the bin directory of CMake to the PATH:

    On a Mac, set PATH to

    export PATH=/Applications/CMake.app/Contents/bin:$PATH

wat2wasm

The compiler puts out '.wat' files (WebAssembly Text format). In order to compile these files into the binary '.wasm', we have to use the wat2wasm tool.

npm install -g webassembly-binary-toolkit

Note: this will take a considerable amount of time to finish!

Get and build the code

To use as2wasm you need - for now - to get and partially build a git repo:

git clone https://github.com/apache/royale-asjs.git
cd royale-asjs
git checkout feature/as2wasm
cd as2wasm
npm run build

Your first as2wasm project

Create a project

cd royale-asjs/wast
npm run create-project -- -dir=[root dir] -name=[project name]

Build your project

cd [root dir] /[project name]
npm run build
Clone this wiki locally