Skip to content

Clarify format of -s parameters in emccArgs in plugin-wasm options #523

@chrispcampbell

Description

@chrispcampbell

In discussion thread #522, @serman noted an issue with passing -s parameters:

I managed to add the -S ASSERTIONS=1 to the wasm plugin:

wasmPlugin({ 
emccArgs: [
"-Wall", "-Os ", 
"-sSTRICT=1 ",
 "-sMALLOC=emmalloc", 
"-sFILESYSTEM=0 ",
 "-sMODULARIZE=1 ",
 "-sSINGLE_FILE=1 ", 
"-sEXPORT_ES6=1 ",
 "-sUSE_ES6_IMPORT_META=0 ", 
"-sENVIRONMENT='web,webview,worker' ", 
"-sEXPORTED_FUNCTIONS='_malloc','_free','_getInitialTime','_getFinalTime','_getSaveper','_setLookup','_runModelWithBuffers']", 
"-sEXPORTED_RUNTIME_METHODS=['cwrap']",
 "-sASSERTIONS=1"] }),

(note: I recommend including an example of this in the documentation since I didn't know that -s params don't have a space between "-s XXXXPARAMXXX" I can add it if you want)

It's interesting that in many of the Emscripten error messages, they show -s arguments with a space, and historically in SDE we have used a space as well, but it looks like the Emscripten documentation was amended at some point to recommend NOT including a space:
https://emscripten.org/docs/tools_reference/emcc.html

Options can be specified as a single argument with or without a space between the -s and option name. e.g. -sFOO or -s FOO. It’s highly recommended you use the notation without space.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions