diff options
author | Chad Austin <chad@imvu.com> | 2013-01-29 12:43:37 -0800 |
---|---|---|
committer | Chad Austin <chad@imvu.com> | 2013-03-04 19:06:20 -0800 |
commit | bd4bc7050b70b71d035327199a18a8e0725d7f1d (patch) | |
tree | ca37a42256c57903837cc8a2a3f5553598f43665 /emscripten.py | |
parent | eff17663bc9460f1f760eaeb9be04450347eba1e (diff) |
allow cwd-relative paths when passing --compiler to emscripten.py
Diffstat (limited to 'emscripten.py')
-rwxr-xr-x | emscripten.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/emscripten.py b/emscripten.py index a0b34751..1ea6e0d7 100755 --- a/emscripten.py +++ b/emscripten.py @@ -44,7 +44,12 @@ def process_funcs(args): ll = ''.join(funcs) + '\n' + meta funcs_file = temp_files.get('.func_%d.ll' % i).name open(funcs_file, 'w').write(ll) - out = shared.run_js(compiler, compiler_engine, [settings_file, funcs_file, 'funcs', forwarded_file] + libraries, stdout=subprocess.PIPE, cwd=path_from_root('src')) + out = shared.run_js( + compiler, + engine=os.path.abspath(compiler_engine), + args=[settings_file, funcs_file, 'funcs', forwarded_file] + libraries, + stdout=subprocess.PIPE, + cwd=path_from_root('src')) shared.try_delete(funcs_file) return out @@ -206,12 +211,15 @@ def emscript(configuration, infile, settings, outfile, libraries=[]): # TODO: minimize size of forwarded data from funcs to what we actually need - if cores == 1 and total_ll_size < MAX_CHUNK_SIZE: assert len(chunks) == 1, 'no point in splitting up without multiple cores' + if cores == 1 and total_ll_size < MAX_CHUNK_SIZE: + assert len(chunks) == 1, 'no point in splitting up without multiple cores' if len(chunks) > 0: if DEBUG: print >> sys.stderr, ' emscript: phase 2 working on %d chunks %s (intended chunk size: %.2f MB, meta: %.2f MB, forwarded: %.2f MB, total: %.2f MB)' % (len(chunks), ('using %d cores' % cores) if len(chunks) > 1 else '', chunk_size/(1024*1024.), len(meta)/(1024*1024.), len(forwarded_data)/(1024*1024.), total_ll_size/(1024*1024.)) - commands = [(i, chunks[i], meta, settings_file, compiler, forwarded_file, libraries) for i in range(len(chunks))] + commands = [ + (i, chunks[i], meta, settings_file, compiler, forwarded_file, libraries) + for i in range(len(chunks))] if len(chunks) > 1: pool = multiprocessing.Pool(processes=cores) @@ -616,7 +624,11 @@ WARNING: You should normally never use this! Use emcc instead. keywords.infile = os.path.abspath(positional[0]) if isinstance(keywords.outfile, basestring): keywords.outfile = open(keywords.outfile, 'w') + + global compiler_engine compiler_engine = keywords.compiler + + global jcache jcache = keywords.jcache temp_files.run_and_clean(lambda: main(keywords)) |