File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 30
30
# NODE Command for running Node.js. Default: `node`.
31
31
# NODE_PATH Path for resolving node modules.
32
32
# EMCCC_COMPILER Emscripten C compiler. Default: `emcc`.
33
- # WASM2WAT Command for converting wasm binary format to text format. Default. `wasm2wat`.
33
+ # WASM2WAT Command for converting WebAssembly binary format to text format. Default. `wasm2wat`.
34
+ # WASM2JS Command for converting WebAssembly binary format to JavaScript. Default. `wasm2js`.
34
35
# SRC_FOLDER Folder containing source files. Default: `src`.
35
36
# INCLUDE Includes (e.g., `-I /foo/bar -I /a/b`).
36
37
# SOURCE_FILES Source file list.
@@ -67,6 +68,12 @@ if [[ -z "${wasm_to_wat}" ]]; then
67
68
wasm_to_wat=' wasm2wat'
68
69
fi
69
70
71
+ # Define the path to an executable for converting a WebAssembly binary to JavaScript:
72
+ wasm_to_js=" ${WASM2JS} "
73
+ if [[ -z " ${wasm_to_js} " ]]; then
74
+ wasm_to_js=' wasm2js'
75
+ fi
76
+
70
77
# Define the folder containing source files:
71
78
src_folder=" ${SRC_FOLDER} "
72
79
if [[ -z " ${src_folder} " ]]; then
@@ -194,7 +201,7 @@ resolve_libpaths() {
194
201
#
195
202
# $1 - source directory
196
203
compile () {
197
- cd " $1 " && EMCC_COMPILER=" ${emcc_compiler} " WASM2WAT=" ${wasm_to_wat} " INCLUDE=" ${include} " SOURCE_FILES=" ${source_files} " LIBRARIES=" ${libraries} " LIBPATH=" ${libpath} " make wasm 2>&1
204
+ cd " $1 " && EMCC_COMPILER=" ${emcc_compiler} " WASM2WAT=" ${wasm_to_wat} " WASM2JS= " ${wasm_to_js} " INCLUDE=" ${include} " SOURCE_FILES=" ${source_files} " LIBRARIES=" ${libraries} " LIBPATH=" ${libpath} " make wasm 2>&1
198
205
if [[ " $? " -ne 0 ]]; then
199
206
echo ' Error when attempting to compile WebAssembly.' >&2
200
207
return 1
You can’t perform that action at this time.
0 commit comments