aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-04-05 17:09:04 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-04-05 17:09:04 -0700
commita65ea6dc5853d4becee51cd8cb8a704e7eae1e95 (patch)
tree5ba563094aec839bec1602944396aec17a7dc566
parent7d495a7fb70ea87c259cc1faed9b5af3fe92aa3c (diff)
do not copy mem file when already in all places
-rwxr-xr-xemcc4
1 files changed, 3 insertions, 1 deletions
diff --git a/emcc b/emcc
index e43199f3..48d507c3 100755
--- a/emcc
+++ b/emcc
@@ -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)