-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Open
Description
Background: Right now to keep alive & export a compiled function one would use EXPORTED_FUNCTIONS, while to ensure a JS library function exists one would use DEFAULT_LIBRARY_FUNCS_TO_INCLUDE, and there is EXPORTED_RUNTIME_METHODS for exporting parts of the JS runtime. This is needlessly complex, and confusing since a C API may be implemented in either compiled code or a JS library, and currently you need to know which in order to properly include and export it.
Proposal:
- A new
EXPORTSsetting, which receives a list of things to ensure exist and are exported in the final output. These can be in compiled code, the JS library, or the JS runtime - the user doesn't need to know. - Deprecate all the other relevant options (but still support them for backwards compatibility for a long time at least), namely
EXPORTED_FUNCTIONS,DEFAULT_LIBRARY_FUNCS_TO_INCLUDE,EXPORTED_RUNTIME_METHODS. - No
_prefixing, likeEXPORTED_RUNTIME_METHODSetc., and unlikeEXPORTED_FUNCTIONS. This moves us further along the path to get us rid of the old prefixing annoyance.
For example, -s EXPORTS=['main', 'emscripten_main_loop', 'AsciiToString'] would export a compiled function, a JS library function, and a runtime function, respectively (and note the lack of _ prefixes).
Thoughts?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels