aboutsummaryrefslogtreecommitdiff
path: root/emscripten.py
diff options
context:
space:
mode:
Diffstat (limited to 'emscripten.py')
-rwxr-xr-xemscripten.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/emscripten.py b/emscripten.py
index dc5d5f5b..44478331 100755
--- a/emscripten.py
+++ b/emscripten.py
@@ -21,6 +21,9 @@ WARNING: You should normally never use this! Use emcc instead.
from tools import shared
DEBUG = os.environ.get('EMCC_DEBUG')
+if DEBUG == "0":
+ DEBUG = None
+DEBUG_CACHE = DEBUG and "cache" in DEBUG
__rootpath__ = os.path.abspath(os.path.dirname(__file__))
def path_from_root(*pathelems):
@@ -145,7 +148,21 @@ def emscript(infile, settings, outfile, libraries=[]):
if jcache:
keys = [pre_input, settings_text, ','.join(libraries)]
shortkey = shared.JCache.get_shortkey(keys)
+ if DEBUG_CACHE: print >>sys.stderr, 'shortkey', shortkey
+
out = shared.JCache.get(shortkey, keys)
+
+ if (not out) and DEBUG_CACHE:
+ dfpath = os.path.join(shared.TEMP_DIR, "ems_" + shortkey)
+ dfp = open(dfpath, 'w')
+ dfp.write(pre_input);
+ dfp.write("\n\n========================== settings_text\n\n");
+ dfp.write(settings_text);
+ dfp.write("\n\n========================== libraries\n\n");
+ dfp.write("\n".join(libraries))
+ dfp.close()
+ print >>sys.stderr, ' cache miss, key data dumped to %s' % dfpath
+
if out and DEBUG: print >> sys.stderr, ' loading pre from jcache'
if not out:
open(pre_file, 'w').write(pre_input)