diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-04-05 17:09:04 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-04-05 17:09:04 -0700 |
commit | a65ea6dc5853d4becee51cd8cb8a704e7eae1e95 (patch) | |
tree | 5ba563094aec839bec1602944396aec17a7dc566 | |
parent | 7d495a7fb70ea87c259cc1faed9b5af3fe92aa3c (diff) |
do not copy mem file when already in all places
-rwxr-xr-x | emcc | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1446,7 +1446,9 @@ try: open(memfile, 'wb').write(''.join(map(lambda x: chr(int(x or '0')), m.groups(0)[0].split(',')))) if DEBUG: # Copy into temp dir as well, so can be run there too - shutil.copyfile(memfile, os.path.join(shared.EMSCRIPTEN_TEMP_DIR, os.path.basename(memfile))) + temp_memfile = os.path.join(shared.EMSCRIPTEN_TEMP_DIR, os.path.basename(memfile)) + if os.path.abspath(memfile) != os.path.abspath(memfile): + shutil.copyfile(memfile, temp_memfile) return 'loadMemoryInitializer("%s");' % os.path.basename(memfile) src = re.sub('/\* memory initializer \*/ allocate\(\[([\d,]+)\], "i8", ALLOC_NONE, TOTAL_STACK\)', repl, src, count=1) open(final + '.mem.js', 'w').write(src) |