Let apps override emscripten settings

Read settings from OLM_OPTIONS to allow apps to configure some options. In
particular, this is useful for setting the heap size.
This commit is contained in:
Richard van der Hoff 2016-12-14 11:41:51 +00:00
parent 1bf807bf33
commit 51b141ecb6

View file

@ -21,5 +21,13 @@ if (typeof(window) !== 'undefined') {
} }
(function() { (function() {
var module; // Shadow the Node 'module' object so that emscripten won't try /* applications should define OLM_OPTIONS in the environment to override
// to fiddle with it. * emscripten module settings */
var Module = {};
if (typeof(OLM_OPTIONS) !== 'undefined') {
for (var key in OLM_OPTIONS) {
if (OLM_OPTIONS.hasOwnProperty(key)) {
Module[key] = OLM_OPTIONS[key];
}
}
}