Customizing WebAssembly Module's Build Properties

Each WebAssembly module is a project that has build properties assigned. The most important of them are described here.

Right click the WebAssembly module and select "Properties".

Build Environment

Unfold the "C/C++ Build" and click "Environment" in the Properties dialog window.

Figure 1. Build Environment

The following environment variables are set/modified for the WebAssembly build:

  • EMCC_SKIP_SANITY_CHECK - turns off/on various sanity checks done by the Emscripten SDK,
  • EMCC_WASM_BACKEND - in current, modified by Samsung, Emscripten SDK version it should be set to '0'. If you ever use other Emscripten SDK, you may need to change it when you encounter build errors like:

error: unknown target triple 'asmjs-unknown-emscripten', please use -triple or -arch

or

shared:ERROR: emcc: WASM_BACKEND selected but could not find lld (wasm-ld): ...

  • EM_CACHE - the path you set in the "Cache directory" when configuring the Emscripten SDK is copied here on each build,
  • EM_CONFIG - the path you set in the "Configuration file" when configuring the Emscripten SDK is copied here on each build,
  • PATH - paths of the Emscripten binary tools are prepended to this PATH variable,
  • WASM_TOOLS_POSTFIX - set to ".bat" extension on Windows OS, empty on other operating systems.

Build Settings

Unfold the "C/C++ Build" and click "Settings" in the Properties dialog window.

Figure 2. Build Settings

The following tabs are customized for the WebAssembly modules build's support:

  • "Tool Settings" - compilation and linking flags can be set here, in particular include and library search paths may be defined and libraries to link may be added.
  • "Build Artifact" - by default, artifact name is set to the WebAssembly module project name and the artifact extension is set to "js". Do not change the extension unless you know what you are doing.