aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-03-12 10:47:35 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-03-12 10:47:35 -0700
commit68988a8603205375341db691db5f843f4080b39a (patch)
tree11db96725b9b3e503e086497cc59519ecd0ed2c0 /src
parent74fc756d57064a7bfa1e69ff6bfe2f1c687be3ae (diff)
support -s KEY=@PATH in emcc, for very large settings values
Diffstat (limited to 'src')
-rw-r--r--src/compiler.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/compiler.js b/src/compiler.js
index 447d34b7..f461bcf7 100644
--- a/src/compiler.js
+++ b/src/compiler.js
@@ -141,8 +141,13 @@ if (phase == 'pre') {
if (settings_file) {
var settings = JSON.parse(read(settings_file));
- for (setting in settings) {
- eval(setting + ' = ' + JSON.stringify(settings[setting]));
+ for (key in settings) {
+ var value = settings[key];
+ if (value[0] == '@') {
+ // response file type thing, workaround for large inputs: value is @path-to-file
+ value = JSON.parse(read(value.substr(1)));
+ }
+ eval(key + ' = ' + JSON.stringify(value));
}
}